ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
Axes.m
Go to the documentation of this file.
1%> \brief
2%> This is the class for generating instances of objects
3%> that contain the specifications of various types of plots.<br>
4%>
5%> \details
6%> This class primarily serves as the superclass for
7%> the visualization-ready subclass [pm.vis.Subplot](@ref Subplot)
8%> and its subclasses, all accessible to the end users.<br>
9%>
10%> Dynamic class attributes
11%> ------------------------
12%>
13%> This class contains a set of attributes that are defined dynamically at runtime
14%> for the output object depending on its subclass (plot type it represents).<br>
15%> The following is the list of all class attributes that are dynamically added
16%> to the instantiated class objects based on the specified input plot type.<br>
17%> See also the explicit class and superclass attributes not listed below.<br>
18%>
19%> <ol>
20%> <li> ``axes`` (available for all subplots except [pm.vis.SubplotHeatmap](@ref SubplotHeatmap))<br>
21%>
22%> A MATLAB ``struct`` whose fields and values are passed as
23%> keyword arguments to the MATLAB intrinsic ``set()`` for
24%> the current active axes object in the plot ``gca()``.<br>
25%>
26%> <li> ``colorbar`` (available for all axes types that allow color-mapping)<br>
27%>
28%> A MATLAB ``struct`` whose fields and their values will
29%> be passed as keyword arguments to the MATLAB intrinsic ``colorbar``.<br>
30%> The following are the default components of ``colorbar``:<br>
31%>
32%> <ol>
33%> <li> ``enabled``
34%>
35%> A ``logical`` value. If ``true``, the
36%> color bar will be applied to the axes.<br>
37%>
38%> <li> others
39%>
40%> See the acceptable keyword arguments
41%> of the MATLAB intrinsic ``colorbar()``.<br>
42%> </ol>
43%>
44%> \warning
45%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
46%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
47%> For example, ``colorbar.color`` and ``colorbar.Color`` are the same,
48%> and only one of the two will be processed.<br>
49%>
50%> \example{colorbar}
51%> \code{.m}
52%>
53%> self.colorbar.enabled = true;
54%> self.colorbar.location = "west";
55%>
56%> \endcode
57%> <br>
58%>
59%> <li> ``colormap`` (available for all axes types that allow color-mapping)
60%>
61%> A MATLAB ``struct`` whose fields and their values will be passed
62%> as keyword arguments to the MATLAB intrinsic ``colormap``.<br>
63%> The following are the default components of ``colormap``:<br>
64%>
65%> <ol>
66%> <li> ``enabled``
67%>
68%> A logical value. If ``true``, the
69%> colormap will be applied to the axes.<br>
70%>
71%> <li> ``map``
72%>
73%> A string or a vector of color triplets or any other value
74%> that the intrinsic MATLAB ``colormap`` accepts as input.<br>
75%>
76%> This option is relevant only to visualizations that allow color-mapping.<br>
77%> </ol>
78%>
79%> \warning
80%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
81%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
82%> For example, ``colormap.map`` and ``colormap.Map`` are the same,
83%> and only one of the two will be processed.<br>
84%>
85%> \example{colormap}
86%> \code{.m}
87%>
88%> self.colormap.enabled = true;
89%> self.colormap.map = "winter";
90%> self.colormap.map = "winter";
91%> self.colormap.map = 'default';
92%> self.colormap.map = pm.vis.cmap.redblue();
93%>
94%> \endcode
95%> <br>
96%>
97%> <li> ``contour`` (available only for [pm.vis.SubplotContour](@ref SubplotContour) axes types)
98%>
99%> A MATLAB ``struct`` whose fields and their values will be passed
100%> as keyword arguments to the MATLAB intrinsic ``contour``.<br>
101%> The following are the default components of ``contour``:<br>
102%>
103%> <ol>
104%> <li> ``enabled``
105%>
106%> A logical value. If ``true``, the
107%> contour will be added to the axes.
108%>
109%> <li> ``levels``
110%>
111%> See the corresponding positional argument of the MATLAB intrinsic ``contourf()``.<br>
112%>
113%> <li> ``lineSpec``
114%>
115%> See the corresponding positional argument of the MATLAB intrinsic ``contourf()``.<br>
116%>
117%> <li> others
118%>
119%> See the acceptable keyword arguments of the MATLAB intrinsic ``contour()``.<br>
120%> </ol>
121%>
122%> \warning
123%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
124%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
125%>
126%> \example{colormap}
127%> \code{.m}
128%>
129%> self.contour.enabled = true;
130%> self.contour.lineWidth = "none";
131%>
132%> \endcode
133%> <br>
134%>
135%> <li> ``contour3`` (available only for [pm.vis.SubplotContour3](@ref SubplotContour3) axes types)
136%>
137%> A MATLAB ``struct`` whose fields and their values will be passed
138%> as keyword arguments to the MATLAB intrinsic ``contour3``.<br>
139%> The following are the default components of ``contour3``:<br>
140%>
141%> <ol>
142%> <li> ``enabled``
143%>
144%> A logical value. If ``true``, the
145%> contour3 will be added to the axes.<br>
146%>
147%> <li> ``levels``
148%>
149%> See the corresponding positional argument of the MATLAB intrinsic ``contourf()``.<br>
150%>
151%> <li> ``lineSpec``
152%>
153%> See the corresponding positional argument of the MATLAB intrinsic ``contourf()``.<br>
154%>
155%> <li> others
156%>
157%> See the acceptable keyword arguments of the MATLAB intrinsic ``contour3()``.<br>
158%> </ol>
159%>
160%> \warning
161%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
162%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
163%>
164%> \example{colormap}
165%> \code{.m}
166%>
167%> self.contour3.enabled = true;
168%> self.contour3.lineWidth = "none";
169%>
170%> \endcode
171%> <br>
172%>
173%> <li> ``contourf`` (available only for [pm.vis.SubplotContourf](@ref SubplotContourf) axes types)
174%>
175%> A MATLAB ``struct`` whose fields and their values will be passed
176%> as keyword arguments to the MATLAB intrinsic ``contourf``.<br>
177%> The following are the default components of ``contourf``:<br>
178%>
179%> <ol>
180%> <li> ``enabled``
181%>
182%> A logical value. If ``true``, the
183%> contourf will be added to the axes.<br>
184%>
185%> <li> ``levels``
186%>
187%> See the corresponding positional argument of the MATLAB intrinsic ``contourf()``.<br>
188%>
189%> <li> ``lineSpec``
190%>
191%> See the corresponding positional argument of the MATLAB intrinsic ``contourf()``.<br>
192%>
193%> <li> others
194%>
195%> See the acceptable keyword arguments of the MATLAB intrinsic ``contourf()``.<br>
196%> </ol>
197%>
198%> \warning
199%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
200%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
201%>
202%> \example{contourf}
203%> \code{.m}
204%>
205%> self.contourf.enabled = true;
206%> self.contourf.lineWidth = "none";
207%>
208%> \endcode
209%> <br>
210%>
211%> <li> ``histfit`` (available only for [pm.vis.SubplotHistfit](@ref SubplotHistfit) axes types)
212%>
213%> A MATLAB ``struct`` whose fields and their values will be passed
214%> as keyword arguments to the MATLAB intrinsic ``histfit``.<br>
215%> The following are the default components of ``histfit``:<br>
216%>
217%> <ol>
218%> <li> ``enabled``
219%>
220%> A logical value. If ``true``, the
221%> histfit will be added to the axes.<br>
222%>
223%> <li> ``nbins``
224%>
225%> See the corresponding positional argument of the MATLAB intrinsic ``histfit()``.<br>
226%>
227%> <li> ``dist``
228%>
229%> See the corresponding positional argument of the MATLAB intrinsic ``histfit()``.<br>
230%> </ol>
231%>
232%> \warning
233%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
234%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
235%>
236%> \example{histfit}
237%> \code{.m}
238%>
239%> self.histfit.enabled = true;
240%> self.histfit.nbins = 20;
241%>
242%> \endcode
243%> <br>
244%>
245%> <li> ``histogram`` (available only for [pm.vis.SubplotHistogram](@ref SubplotHistogram) axes types)
246%>
247%> A MATLAB ``struct`` whose fields and their values will be passed
248%> as keyword arguments to the MATLAB intrinsic ``histogram``.<br>
249%> The following are the default components of ``histogram``:<br>
250%>
251%> <ol>
252%> <li> ``enabled``
253%>
254%> A logical value. If ``true``, the
255%> histogram will be added to the axes.<br>
256%>
257%> <li> ``nbins``
258%>
259%> See the corresponding positional argument of the MATLAB intrinsic ``histogram()``.<br>
260%>
261%> <li> ``edges``
262%>
263%> See the corresponding positional argument of the MATLAB intrinsic ``histogram()``.<br>
264%>
265%> <li> others
266%>
267%> See the corresponding acceptable keyword arguments of the MATLAB intrinsic ``histogram()``.<br>
268%> </ol>
269%>
270%> \warning
271%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
272%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
273%>
274%> \example{histogram}
275%> \code{.m}
276%>
277%> self.histogram.enabled = true;
278%> self.histogram.edgeColor = "none";
279%> self.histogram.nbins = 20;
280%>
281%> \endcode
282%> <br>
283%>
284%> <li> ``histogram2`` (available only for [pm.vis.SubplotHistogram2](@ref SubplotHistogram2) axes types)
285%>
286%> A MATLAB ``struct`` whose fields and their values will be passed
287%> as keyword arguments to the MATLAB intrinsic ``histogram2``.<br>
288%> The following are the default components of ``histogram2``:<br>
289%>
290%> <ol>
291%> <li> ``enabled``
292%>
293%> A logical value. If ``true``, the
294%> histogram2 will be added to the axes.<br>
295%>
296%> <li> ``nbins``
297%>
298%> See the corresponding positional argument of the MATLAB intrinsic ``histogram2()``.<br>
299%>
300%> <li> ``xedges``
301%>
302%> See the corresponding positional argument of the MATLAB intrinsic ``histogram2()``.<br>
303%>
304%> <li> ``yedges``
305%>
306%> See the corresponding positional argument of the MATLAB intrinsic ``histogram2()``.<br>
307%>
308%> <li> others
309%>
310%> See the corresponding acceptable keyword arguments of the MATLAB intrinsic ``histogram2()``.<br>
311%> </ol>
312%>
313%> \warning
314%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
315%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
316%>
317%> \example{histogram2}
318%> \code{.m}
319%>
320%> self.histogram2.enabled = true;
321%> self.histogram2.edgeColor = "none";
322%> self.histogram2.nbins = 20;
323%>
324%> \endcode
325%> <br>
326%>
327%> <li> ``legend`` (available for all axes types except [pm.vis.SubplotHeatmap](@ref SubplotHeatmap))
328%>
329%> A MATLAB ``struct`` whose fields and values are passed
330%> as keyword arguments to the MATLAB intrinsic ``title()``.<br>
331%>
332%> <li> ``maxnoise`` (available only for [pm.vis.SubplotContour](@ref SuplotContour)/[pm.vis.SubplotContourf](@ref SuplotContourf)/[pm.vis.SubplotContour3](@ref SuplotContour3) axes types)
333%>
334%> A float indicating the threshold below which the kernel density
335%> estimate is considered to be noise and is rounded to zero.<br>
336%> The higher this value is, the less noise will be
337%> visible in the resulting contour plots.<br>
338%> If empty, the default value is ``0.001``.<br>
339%>
340%> <li> ``plot`` (available only for [pm.vis.SubplotLine](@ref SubplotLine), [pm.vis.SubplotLineScatter](@ref SubplotLineScatter) axes types)
341%>
342%> A MATLAB ``struct`` whose fields and their values will be passed
343%> as keyword arguments to the MATLAB intrinsic ``plot``.<br>
344%> The following are the default components of ``plot``:<br>
345%>
346%> <ol>
347%> <li> ``enabled``
348%>
349%> A logical value. If ``true``, the
350%> plot will be added to the axes.<br>
351%>
352%> <li> ``lineSpec``
353%>
354%> See the corresponding positional argument of the MATLAB intrinsic ``plot()``.<br>
355%>
356%> <li> others
357%>
358%> See the corresponding acceptable keyword arguments of the MATLAB intrinsic ``plot()``.<br>
359%> </ol>
360%>
361%> \warning
362%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
363%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
364%>
365%> \example{plot}
366%> \code{.m}
367%>
368%> self.plot.enabled = true;
369%> self.plot.lineWidth = 1;
370%>
371%> \endcode
372%> <br>
373%>
374%> <li> ``plot3`` (available only for [pm.vis.SubplotLine3](@ref SubplotLine3)/[pm.vis.SubplotLineScatter3](@ref SubplotLineScatter3) axes types)
375%>
376%> A MATLAB ``struct`` whose fields and their values will be passed
377%> as keyword arguments to the MATLAB intrinsic ``plot3``.<br>
378%> The following are the default components of ``plot3``:<br>
379%>
380%> <ol>
381%> <li> ``enabled``
382%>
383%> A logical value. If ``true``, the
384%> ``plot3`` will be added to the axes.<br>
385%>
386%> <li> ``lineSpec``
387%>
388%> See the corresponding positional argument of the MATLAB intrinsic ``plot3()``.<br>
389%>
390%> <li> others
391%>
392%> See the corresponding acceptable keyword arguments of the MATLAB intrinsic ``plot3()``.<br>
393%> </ol>
394%>
395%> \warning
396%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
397%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
398%>
399%> \example{plot3}
400%> \code{.m}
401%>
402%> self.plot3.enabled = true;
403%> self.plot3.lineWidth = 1;
404%>
405%> \endcode
406%> <br>
407%>
408%> <li> ``precision`` (available only for [pm.vis.SubplotHeatmap](@ref SubplotHeatmap) axes types)
409%>
410%> A scalar integer representing the number of digits after
411%> the decimal point for the values that appear in each cell
412%> of the heatmap. The default value is set by MATLAB.<br>
413%>
414%> <li> ``resolution`` (available only for [pm.vis.SubplotContour](@ref SuplotContour),
415%> [pm.vis.SubplotContourf](@ref SuplotContourf), [pm.vis.SubplotContour3](@ref SuplotContour3) axes types)
416%>
417%> A scalar integer indicating the grid resolution for discretization of
418%> the data during the kernel density estimation. It must be a power of
419%> two, otherwise it will be changed to the next power of two at the
420%> time of using it. If empty, the default value is ``2^9``.<br>
421%>
422%> <li> ``scatter`` (available only for [pm.vis.SubplotScatter](@ref SubplotScatter), [pm.vis.SubplotLineScatter](@ref SubplotLineScatter) axes types)
423%>
424%> A MATLAB ``struct`` whose fields and their values will be passed
425%> as keyword arguments to the MATLAB intrinsic ``scatter``.<br>
426%> The following are the default components of ``scatter``:<br>
427%>
428%> <ol>
429%> <li> ``enabled``
430%>
431%> A logical value. If ``true``, the
432%> scatter will be added to the axes.<br>
433%>
434%> <li> ``size``
435%>
436%> See the corresponding ``sz`` positional argument of the MATLAB intrinsic ``plot3()``.<br>
437%>
438%> <li> ``color``
439%>
440%> See the corresponding ``C`` positional argument of the MATLAB intrinsic ``plot3()``.<br>
441%>
442%> <li> ``filled``
443%>
444%> See the corresponding ``filled`` positional argument of the MATLAB intrinsic ``plot3()``.<br>
445%>
446%> <li> ``marker``
447%>
448%> See the corresponding ``mkr`` positional argument of the MATLAB intrinsic ``plot3()``.<br>
449%>
450%> <li> others
451%>
452%> See the corresponding acceptable keyword arguments of the MATLAB intrinsic ``scatter()``.<br>
453%> </ol>
454%>
455%> \warning
456%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
457%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
458%>
459%> \example{scatter}
460%> \code{.m}
461%>
462%> self.scatter.enabled = true; % add scatter()
463%> self.scatter.color = "red"; % set the points color
464%> self.scatter.marker = "."; % set the marker type
465%> self.scatter.size = 10; % set the point size
466%> self.scatter.lineWidth = 0;
467%>
468%> \endcode
469%> <br>
470%>
471%> <li> ``scatter3`` (available only for [pm.vis.SubplotScatter3](@ref SubplotScatter3), [pm.vis.SubplotLineScatter3](@ref SubplotLineScatter3) axes types)
472%>
473%> A MATLAB ``struct`` whose fields and their values will be passed
474%> as keyword arguments to the MATLAB intrinsic ``scatter3``.<br>
475%> The following are the default components of ``scatter3``:<br>
476%>
477%> <ol>
478%> <li> ``enabled``
479%>
480%> A logical value. If ``true``, the
481%> scatter3 will be added to the axes.<br>
482%>
483%> <li> ``size``
484%>
485%> See the corresponding ``sz`` positional argument of the MATLAB intrinsic ``plot3()``.<br>
486%>
487%> <li> ``color``
488%>
489%> See the corresponding ``C`` positional argument of the MATLAB intrinsic ``plot3()``.<br>
490%>
491%> <li> ``filled``
492%>
493%> See the corresponding ``filled`` positional argument of the MATLAB intrinsic ``plot3()``.<br>
494%>
495%> <li> ``marker``
496%>
497%> See the corresponding ``mkr`` positional argument of the MATLAB intrinsic ``plot3()``.<br>
498%>
499%> <li> others
500%>
501%> See the corresponding acceptable keyword arguments of the MATLAB intrinsic ``scatter3()``.<br>
502%> </ol>
503%>
504%> \warning
505%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
506%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
507%>
508%> \example{scatter3}
509%> \code{.m}
510%>
511%> self.scatter3.enabled = true; % add scatter3()
512%> self.scatter3.color = "red"; % set the points color
513%> self.scatter3.marker = "."; % set the marker type
514%> self.scatter3.size = 10; % set the point size
515%> self.scatter3.lineWidth = 0;
516%>
517%> \endcode
518%> <br>
519%>
520%> <li> ``surface`` (available only for [pm.vis.SubplotLine](@ref SubplotLine), [pm.vis.SubplotLineScatter](@ref pm.vis.SubplotLineScatter),
521%> [pm.vis.SubplotLine3](@ref SubplotLine3)/[pm.vis.SubplotLineScatter3](@ref SubplotLineScatter3) axes types)
522%>
523%> A MATLAB ``struct`` whose fields and their values will be passed
524%> as keyword arguments to the MATLAB intrinsic ``surface``.<br>
525%> The following are the default components of ``surface``:<br>
526%>
527%> <ol>
528%> <li> ``enabled``
529%>
530%> A logical value. If ``true``, the
531%> surface will be added to the axes.<br>
532%>
533%> <li> others
534%>
535%> See the corresponding acceptable keyword arguments of the MATLAB intrinsic ``surface()``.<br>
536%> </ol>
537%>
538%> \warning
539%> Keep in mind that MATLAB keyword arguments are case-INsensitive.<br>
540%> Hence, ensure you do not add the same keyword as multiple different fields.<br>
541%>
542%> \example{surface}
543%> \code{.m}
544%>
545%> self.surface.enabled = true;
546%> self.surface.edgeColor = 1;
547%>
548%> \endcode
549%> <br>
550%>
551%> <li> ``title`` (available for all axes types)
552%>
553%> A MATLAB ``struct`` whose fields and values are passed
554%> as keyword arguments to the MATLAB intrinsic ``title()``.<br>
555%>
556%> <li> ``xlabel`` (available for all axes types)
557%>
558%> A MATLAB ``struct`` whose fields and values are passed
559%> as keyword arguments to the MATLAB intrinsic ``xlabel()``.<br>
560%>
561%> <li> ``ylabel`` (available for all axes types)
562%>
563%> A MATLAB ``struct`` whose fields and values are passed
564%> as keyword arguments to the MATLAB intrinsic ``ylabel()``.<br>
565%>
566%> <li> ``zlabel`` (available only for all tri-axes axes types)
567%>
568%> A MATLAB ``struct`` whose fields and values are passed
569%> as keyword arguments to the MATLAB intrinsic ``zlabel()``.<br>
570%>
571%> <li> ``xlim`` (available for all axes types, except [pm.vis.SubplotHeatmap](@ref SubplotHeatmap))
572%>
573%> A MATLAB vector of length ``2`` whose fields and values are
574%> passed as keyword arguments to the MATLAB intrinsic ``xlim()``.<br>
575%>
576%> <li> ``ylim`` (available for all axes types, except [pm.vis.SubplotHeatmap](@ref SubplotHeatmap))
577%>
578%> A MATLAB vector of length ``2`` whose fields and values are
579%> passed as keyword arguments to the MATLAB intrinsic ``ylim()``.<br>
580%>
581%> <li> ``zlim`` (available only for all tri-axes axes types)
582%>
583%> A MATLAB vector of length ``2`` whose fields and values are
584%> passed as keyword arguments to the MATLAB intrinsic ``zlim()``.<br>
585%>
586%> <li> ``xscale`` (available for all axes types, except [pm.vis.SubplotHeatmap](@ref SubplotHeatmap))
587%>
588%> A MATLAB string whose value is passed directly to the MATLAB intrinsic
589%> ``xscale()`` to set the axis scale to either logarithmic or linear.<br>
590%> Possible values are: ``"log"``, ``"linear"``.<br>
591%> The default behavior is set by MATLAB.<br>
592%>
593%> <li> ``yscale`` (available for all axes types, except [pm.vis.SubplotHeatmap](@ref SubplotHeatmap))
594%>
595%> A MATLAB string whose value is passed directly to the MATLAB intrinsic
596%> ``yscale()`` to set the axis scale to either logarithmic or linear.<br>
597%> Possible values are: ``"log"``, ``"linear"``.<br>
598%> The default behavior is set by MATLAB.<br>
599%>
600%> <li> ``zscale`` (available only for all tri-axes axes types)
601%>
602%> A MATLAB string whose value is passed directly to the MATLAB intrinsic
603%> ``zscale()`` to set the axis scale to either logarithmic or linear.<br>
604%> Possible values are: ``"log"``, ``"linear"``.<br>
605%> The default behavior is set by MATLAB.<br>
606%> </ol>
607%>
608%> \devnote
609%> While dynamic addition of class attributes is not ideal, the current
610%> design was deemed unavoidable and best, given the constraints of the
611%> MATLAB language and visualization tools.<br>
612%>
613%> \see
614%> [pm.matlab.Handle](@ref Handle)<br>
615%>
616%> \final
617%>
618%> \author
619%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
620%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
621classdef Axes < pm.matlab.Handle
622
623 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
624
625 properties(Access = protected, Hidden)
626 %>
627 %> ``type``
628 %>
629 %> An auxiliary MATLAB ``struct`` containing plot type information.
630 %>
631 type = struct();
632 %>
633 %> ``cenabled``
634 %>
635 %> An auxiliary scalar MATLAB ``logical`` that is true if plot is color-mapped.
636 %>
637 cenabled = [];
638 end
639
640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
642 methods(Access = public)
643
644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
645
646 %> \brief
647 %> Construct and return an object of class [pm.vis.axes.Axes](@ref Axes).<br>
648 %>
649 %> \details
650 %> This function is the constructor of the class [pm.vis.axes.Axes](@ref Axes).<br>
651 %> For more information, see the documentation of the class [pm.vis.axes.Axes](@ref Axes).<br>
652 %>
653 %> \param[in] ptype : The input scalar MATLAB string containing the name of the
654 %> subclass that whose parent is Axes (e.g., "heatmap").<br>
655 %> Supported plot names are:<br>
656 %> <ol>
657 %> <li> ``"line"``
658 %> <li> ``"line3"``
659 %> <li> ``"scatter"``
660 %> <li> ``"scatter3"``
661 %> <li> ``"lineScatter"``
662 %> <li> ``"lineScatter3"``
663 %> <li> ``"histogram2"``
664 %> <li> ``"histogram"``
665 %> <li> ``"contour3"``
666 %> <li> ``"contourf"``
667 %> <li> ``"contour"``
668 %> <li> ``"histfit"``
669 %> <li> ``"heatmap"``
670 %> </ol>
671 %>
672 %> \param[in] varargin : Any ``property, value`` pair of the object.<br>
673 %> If the property is a ``struct()``, then its value must be given as a cell array,
674 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
675 %> Note that all of these property-value pairs can be also directly set via the
676 %> parent object attributes, before calling the ``premake()`` method.<br>
677 %>
678 %> \return
679 %> ``self`` : The output scalar object of class [pm.vis.axes.Axes](@ref Axes).<br>
680 %>
681 %> \interface{Axes}
682 %> \code{.m}
683 %>
684 %> axes = pm.vis.axes.Axes(ptype);
685 %>
686 %> \endcode
687 %>
688 %> \example{Axes}
689 %> \include{lineno} example/vis/axes/Axes/main.m
690 %> \output{Axes}
691 %> \include{lineno} example/vis/axes/Axes/main.out.m
692 %>
693 %> \final{Axes}
694 %>
695 %> \author
696 %> \JoshuaOsborne, May 21 2024, 5:59 AM, University of Texas at Arlington<br>
697 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
698 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
699 function self = Axes(ptype, varargin)
700
701 if nargin < 1 || ~pm.introspection.istype(ptype, "string", 1) || ~pm.array.len(ptype)
702 help("pm.vis.axes.Axes");
703 error ( newline ...
704 + "The input argument ``ptype`` is missing." + newline ...
705 + "For more information, see the class documentation displayed above." + newline ...
706 + newline ...
707 );
708 else
709 % lower the first character.
710 ptype = string(ptype);
711 ptype{1} = lower(ptype{1});
712 end
713
714 self.type = struct();
715 self.type.name = ptype;
716 pnamel = lower(ptype);
717 self.type.is.line = strcmpi(pnamel, "line" );
718 self.type.is.line3 = strcmpi(pnamel, "line3" );
719 self.type.is.scatter = strcmpi(pnamel, "scatter" );
720 self.type.is.scatter3 = strcmpi(pnamel, "scatter3" );
721 self.type.is.lineScatter = strcmpi(pnamel, "lineScatter" );
722 self.type.is.lineScatter3 = strcmpi(pnamel, "lineScatter3");
723 self.type.is.histogram2 = strcmpi(pnamel, "histogram2" );
724 self.type.is.histogram = strcmpi(pnamel, "histogram" );
725 self.type.is.contour3 = strcmpi(pnamel, "contour3" );
726 self.type.is.contourf = strcmpi(pnamel, "contourf" );
727 self.type.is.contour = strcmpi(pnamel, "contour" );
728 self.type.is.heatmap = strcmpi(pnamel, "heatmap" );
729 self.type.is.histfit = strcmpi(pnamel, "histfit" );
730 self.type.is.diffusion = self.type.is.contour || self.type.is.contourf || self.type.is.contour3;
731 self.type.is.density = self.type.is.diffusion || self.type.is.histfit || self.type.is.histogram || self.type.is.histogram2;
732 self.type.is.d3 = self.type.is.line3 || self.type.is.scatter3 || self.type.is.lineScatter3;
733 self.type.is.d1 = self.type.is.histfit || self.type.is.histogram || self.type.is.heatmap;
734 self.type.is.d2 = ~(self.type.is.d1 || self.type.is.d3);
735 self.type.is.triaxes = self.type.is.d3 || self.type.is.histogram2 || self.type.is.contour3;
736 %self.type.is.targetable = false; %xx ~self.type.is.heatmap && ~ self.type.is.d3;
737 self.type.has.line = self.type.is.line || self.type.is.line3 || self.type.is.lineScatter || self.type.is.lineScatter3;
738 self.type.has.scatter = self.type.is.scatter || self.type.is.scatter3 || self.type.is.lineScatter || self.type.is.lineScatter3;
739
740 self.reset(varargin{:}); % This is the subclass method!
741
742 end
743
744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
745
746 %> \brief
747 %> Reset the properties of the plot to the original default settings and return nothing.<br>
748 %>
749 %> \details
750 %> Use this method when you change many attributes of the plot and
751 %> you want to clean up and go back to the default settings.<br>
752 %>
753 %> \param[inout] self : The input/output parent object of class [pm.vis.axes.Axes](@ref Axes)
754 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
755 %> \param[in] varargin : Any ``property, value`` pair of the parent object.<br>
756 %> If the property is a ``struct()``, then its value must be given as a cell array,
757 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
758 %> Note that all of these property-value pairs can be also directly set via the
759 %> parent object attributes.<br>
760 %>
761 %> \interface{reset}
762 %> \code{.m}
763 %>
764 %> a = pm.vis.axes.Axes(ptype)
765 %>
766 %> a.reset(varargin) % reset the plot to settings in ``varargin`` and the rest to default.
767 %> a.reset() % reset the plot to the default settings.
768 %>
769 %> \endcode
770 %>
771 %> \final{reset}
772 %>
773 %> \author
774 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
775 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
776 function reset(self, varargin)
777
778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
779 %%%% RULE 0: Any non-MATLAB-default setting must be preferably set in the premake() method to override user null values.
780 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
781
782 fontSize_def = 12;
783
784 %%%% axes
785
786 if ~self.type.is.heatmap
787 self.newprop("axes", struct());
788 self.axes.box = [];
789 self.axes.color = [];
790 self.axes.colorScale = [];
791 self.axes.fontName = [];
792 self.axes.fontSize = fontSize_def;
793 self.axes.fontSizeMode = [];
794 self.axes.fontSmoothing = [];
795 self.axes.fontWeight = [];
796 self.axes.xgrid = [];
797 self.axes.ygrid = [];
798 if self.type.is.triaxes
799 self.axes.zgrid = [];
800 end
801 self.axes.enabled = [];
802 end
803
804 %%%% title
805
806 self.newprop("title", struct());
807 if ~self.type.is.heatmap
808 self.title.fontSize = fontSize_def;
809 self.title.interpreter = [];
810 self.title.fontWeight = [];
811 self.title.color = []; %[0, 0, 0];
812 end
813 self.title.enabled = [];
814 self.title.titletext = [];
815 if ~self.type.is.heatmap
816 self.title.subtitletext = [];
817 end
818
819 %%%% xlabel, xlim
820
821 self.newprop("xlabel", struct());
822 if ~self.type.is.heatmap
823 self.xlabel.color = []; %[0.15, 0.15, 0.15];
824 self.xlabel.fontAngle = [];
825 self.xlabel.fontSize = fontSize_def;
826 self.xlabel.fontWeight = [];
827 self.xlabel.interpreter = [];
828 self.xlabel.rotation = [];
829 self.newprop("xscale", []);
830 self.newprop("xlim", []);
831 end
832 self.xlabel.enabled = [];
833 self.xlabel.txt = [];
834
835
836 %%%% ylabel, ylim
837
838 self.newprop("ylabel", self.xlabel);
839 if ~self.type.is.heatmap
840 self.newprop("yscale", []);
841 self.newprop("ylim", []);
842 end
843
844 %%%% zlabel, zlim
845
846 if self.type.is.triaxes
847 self.newprop("zlabel", self.xlabel);
848 self.newprop("zlim", []);
849 self.newprop("zscale", []);
850 end
851
852 %%%% colc, colorbar, colormap
853
854 if self.type.is.heatmap || ~self.type.is.d1
855
856 if self.type.has.line || self.type.has.scatter
857 self.newprop("colc", {});
858 end
859
860 if ~self.type.is.heatmap
861 self.newprop("colorbar", struct());
862 self.colorbar.fontSize = fontSize_def;
863 self.colorbar.direction = 'normal';
864 self.colorbar.limits = [];
865 self.colorbar.location = 'eastoutside';
866 self.colorbar.ticks = [];
867 self.colorbar.tickLabels = [];
868 self.colorbar.tickLabelInterpreter = 'tex';
869 self.colorbar.enabled = [];
870 end
871
872 self.newprop("colormap", struct());
873 self.colormap.enabled = [];
874 self.colormap.map = []; % 'default'
875
876 end
877
878 %%%% legend
879
880 if ~self.type.is.heatmap
881 self.newprop("legend", struct());
882 self.legend.box = 'off';
883 self.legend.color = 'none';
884 self.legend.fontSize = fontSize_def;
885 self.legend.interpreter = 'none';
886 self.legend.location = [];
887 self.legend.numColumns = [];
888 self.legend.textColor = [];
889 self.legend.enabled = [];
890 self.legend.labels = {};
891 end
892
893 %%%% target
894
895 %if ~self.type.is.targetable
896 % self.newprop("target");
897 %end
898
899 %%%%%%%%%%%%%%%%%%%%%%%
900 %%%% heatmap attributes
901 %%%%%%%%%%%%%%%%%%%%%%%
902
903 if self.type.is.heatmap
904 self.newprop("heatmap", struct());
905 self.newprop("precision", []);
906 self.heatmap.colorbarVisible = [];
907 self.heatmap.colorLimits = [];
908 self.heatmap.missingDataColor = [];
909 self.heatmap.fontName = [];
910 self.heatmap.fontSize = fontSize_def;
911 self.heatmap.enabled = [];
912 end
913
914 %%%%%%%%%%%%%%%%%%%%%%%
915 %%%% density attributes
916 %%%%%%%%%%%%%%%%%%%%%%%
917
918 if self.type.is.histfit
919 self.newprop("histfit", struct());
920 self.histfit.enabled = [];
921 self.histfit.dist = [];
922 self.histfit.nbins = [];
923 end
924
925 if self.type.is.histogram
926 self.newprop("histogram", struct());
927 self.histogram.binLimitsMode = [];
928 self.histogram.binMethod = [];
929 self.histogram.binWidth = [];
930 self.histogram.displayStyle = [];
931 self.histogram.edgeAlpha = [];
932 self.histogram.edgeColor = [];
933 self.histogram.faceAlpha = [];
934 self.histogram.faceColor = [];
935 self.histogram.lineStyle = [];
936 self.histogram.lineWidth = [];
937 self.histogram.normalization = [];
938 self.histogram.orientation = [];
939 self.histogram.enabled = [];
940 self.histogram.edges = [];
941 self.histogram.nbins = [];
942 end
943
944 if self.type.is.histogram2
945 self.newprop("histogram2", struct());
946 self.histogram2.binWidth = [];
947 self.histogram2.xbinLimits = [];
948 self.histogram2.xbinLimitsMode = [];
949 self.histogram2.ybinLimits = [];
950 self.histogram2.ybinLimitsMode = [];
951 self.histogram2.binMethod = [];
952 self.histogram2.showEmptyBins = [];
953 self.histogram2.normalization = [];
954 self.histogram2.displayStyle = [];
955 self.histogram2.edgeAlpha = [];
956 self.histogram2.edgeColor = [];
957 self.histogram2.faceAlpha = [];
958 self.histogram2.faceColor = [];
959 self.histogram2.faceLighting = [];
960 self.histogram2.lineStyle = [];
961 self.histogram2.lineWidth = [];
962 self.histogram2.enabled = [];
963 self.histogram2.nbins = [];
964 self.histogram2.xedges = [];
965 self.histogram2.yedges = [];
966 end
967
968 if self.type.is.contour || self.type.is.contourf || self.type.is.contour3
969 self.newprop("resolution", 2^9);
970 self.newprop("maxnoise", 0.001);
971 end
972
973 if self.type.is.contour
974 self.newprop("contour", struct());
975 self.contour.color = [];
976 self.contour.labelSpacing = [];
977 self.contour.lineWidth = [];
978 self.contour.showText = [];
979 self.contour.enabled = [];
980 self.contour.levels = [];
981 self.contour.lineSpec = [];
982 end
983
984 if self.type.is.contourf
985 self.newprop("contourf", struct());
986 self.contourf.edgecolor = [];
987 self.contourf.color = [];
988 self.contourf.labelSpacing = [];
989 self.contourf.lineWidth = [];
990 self.contourf.showText = [];
991 self.contourf.enabled = [];
992 self.contourf.levels = [];
993 self.contourf.lineSpec = [];
994 end
995
996 if self.type.is.contour3
997 self.newprop("contour3", struct());
998 self.contour3.color = [];
999 self.contour3.labelSpacing = [];
1000 self.contour3.lineWidth = [];
1001 self.contour3.showText = [];
1002 self.contour3.enabled = [];
1003 self.contour3.levels = [];
1004 self.contour3.lineSpec = [];
1005 end
1006
1007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
1008 %%%% line/scatter attributes
1009 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
1010
1011 if self.type.is.line || self.type.is.lineScatter
1012 self.newprop("surface", struct());
1013 self.newprop("plot", struct());
1014 self.plot.color = [];
1015 self.plot.lineWidth = [];
1016 self.plot.lineStyle = [];
1017 self.plot.markeredgeColor = [];
1018 self.plot.markerFaceColor = [];
1019 self.plot.markerIndices = [];
1020 self.plot.markerSize = [];
1021 self.plot.enabled = [];
1022 end
1023
1024 if self.type.is.line3 || self.type.is.lineScatter3
1025 self.newprop("surface", struct());
1026 self.newprop("plot3", struct());
1027 self.plot3.color = {};
1028 self.plot3.lineWidth = {};
1029 self.plot3.lineStyle = '-';
1030 self.plot3.markeredgeColor = [];
1031 self.plot3.markerFaceColor = [];
1032 self.plot3.markerIndices = [];
1033 self.plot3.markerSize = [];
1034 self.plot3.enabled = [];
1035 end
1036
1037 if isprop(self, "surface")
1038 self.surface.alignVertexCenters = {};
1039 self.surface.backFaceLighting = {};
1040 self.surface.edgeAlpha = {};
1041 self.surface.edgeColor = {};
1042 self.surface.edgeLighting = {};
1043 self.surface.faceAlpha = {};
1044 self.surface.faceColor = {};
1045 self.surface.faceLighting = {};
1046 self.surface.lineStyle = {};
1047 self.surface.lineWidth = {};
1048 self.surface.marker = {};
1049 self.surface.markerEdgeColor = {};
1050 self.surface.markerFaceColor = {};
1051 self.surface.markerSize = {};
1052 self.surface.meshStyle = {};
1053 self.surface.enabled = [];
1054 end
1055
1056 if self.type.is.scatter || self.type.is.lineScatter
1057 self.newprop("scatter", struct());
1058 self.scatter.colorVariable = [];
1059 self.scatter.lineWidth = [];
1060 self.scatter.markeredgeColor = [];
1061 self.scatter.markerFaceColor = [];
1062 self.scatter.enabled = [];
1063 self.scatter.color = [];
1064 self.scatter.filled = [];
1065 self.scatter.marker = [];
1066 self.scatter.size = [];
1067 end
1068
1069 if self.type.is.scatter3 || self.type.is.lineScatter3
1070 self.newprop("scatter3", struct());
1071 self.scatter3.colorVariable = [];
1072 self.scatter3.lineWidth = [];
1073 self.scatter3.markeredgeColor = [];
1074 self.scatter3.markerFaceColor = [];
1075 self.scatter3.enabled = [];
1076 self.scatter3.color = [];
1077 self.scatter3.filled = [];
1078 self.scatter3.marker = [];
1079 self.scatter3.size = [];
1080 end
1081
1082 %if self.type.is.targetable
1083 % self.target = pm.vis.Target();
1084 %end
1085
1086 if ~isempty(varargin)
1087 self.hash2comp(varargin); % parse arguments
1088 end
1089 %self.premake(varargin{:}); % This is the subclass method!
1090
1091 end
1092
1093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1094
1095 end
1096
1097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1098
1099 methods(Access = public, Hidden)
1100
1101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1102
1103 %> \brief
1104 %> Configure the plot settings and specifications and return nothing.<br>
1105 %>
1106 %> \param[inout] self : The input/output parent object of class [pm.vis.axes.Axes](@ref Axes)
1107 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
1108 %> \param[in] varargin : Any ``property, value`` pair of the parent object.<br>
1109 %> If the property is a ``struct()``, then its value must be given as a cell array,
1110 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
1111 %> Note that all of these property-value pairs can be also directly set via the
1112 %> parent object attributes, before calling the ``premake()`` method.<br>
1113 %>
1114 %> \interface{premake}
1115 %> \code{.m}
1116 %>
1117 %> a = pm.vis.axes.Axes(ptype);
1118 %>
1119 %> a.premake(varargin);
1120 %> a.premake();
1121 %>
1122 %> \endcode
1123 %>
1124 %> \warning
1125 %> This method has side-effects by manipulating
1126 %> the existing attributes of the parent object.<br>
1127 %>
1128 %> \example{premake}
1129 %> \code{.m}
1130 %>
1131 %> a = pm.vis.axes.Axes("line");
1132 %> a.premake("xlim", [0, 1])
1133 %>
1134 %> \endcode
1135 %>
1136 %> \final{premake}
1137 %>
1138 %> \author
1139 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
1140 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
1141 function premake(self, varargin)
1142
1143 if ~isempty(varargin)
1144 self.hash2comp(varargin); % parse arguments
1145 end
1146
1147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1148 %%%% These settings must happen here so that they can be reset every time user nullifies the values.
1149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1150
1151 %%%%
1152 %%%% Set the enabled visualization components.
1153 %%%%
1154
1155 if isprop(self, "axes") && isempty(self.axes.enabled)
1156 self.axes.enabled = true;
1157 end
1158
1159 if isprop(self, "title") && isempty(self.title.enabled)
1160 self.title.enabled = ~isempty(self.title.titletext);
1161 end
1162
1163 if isprop(self, "xlabel") && isempty(self.xlabel.enabled)
1164 self.xlabel.enabled = true;
1165 end
1166
1167 if isprop(self, "ylabel") && isempty(self.ylabel.enabled)
1168 self.ylabel.enabled = true;
1169 end
1170
1171 if isprop(self, "zlabel") && isempty(self.zlabel.enabled)
1172 self.zlabel.enabled = true;
1173 end
1174
1175 if isprop(self, "colorbar") && isempty(self.colorbar.enabled)
1176 self.colorbar.enabled = true;
1177 end
1178
1179 if isprop(self, "colormap") && isempty(self.colormap.enabled)
1180 self.colormap.enabled = true;
1181 end
1182
1183 if isprop(self, "contour") && isempty(self.contour.enabled)
1184 self.contour.enabled = true;
1185 end
1186
1187 if isprop(self, "contourf") && isempty(self.contourf.enabled)
1188 self.contourf.enabled = true;
1189 end
1190
1191 if isprop(self, "contour3") && isempty(self.contour3.enabled)
1192 self.contour3.enabled = true;
1193 end
1194
1195 if isprop(self, "heatmap") && isempty(self.heatmap.enabled)
1196 self.heatmap.enabled = true;
1197 end
1198
1199 if isprop(self, "histfit") && isempty(self.histfit.enabled)
1200 self.histfit.enabled = true;
1201 end
1202
1203 if isprop(self, "histogram") && isempty(self.histogram.enabled)
1204 self.histogram.enabled = true;
1205 end
1206
1207 if isprop(self, "histogram2") && isempty(self.histogram2.enabled)
1208 self.histogram2.enabled = true;
1209 end
1210
1211 if isprop(self, "legend") && isempty(self.legend.enabled)
1212 self.legend.enabled = false;
1213 end
1214
1215 if isprop(self, "plot") && isempty(self.plot.enabled)
1216 self.plot.enabled = true;
1217 end
1218
1219 if isprop(self, "plot3") && isempty(self.plot3.enabled)
1220 self.plot3.enabled = true;
1221 end
1222
1223 if isprop(self, "scatter") && isempty(self.scatter.enabled)
1224 self.scatter.enabled = true;
1225 end
1226
1227 if isprop(self, "scatter3") && isempty(self.scatter3.enabled)
1228 self.scatter3.enabled = true;
1229 end
1230
1231 %%%%
1232 %%%% ensure line plots are monochromatic when there is scatter plot.
1233 %%%%
1234
1235 if self.type.has.line
1236 if self.type.has.scatter && isempty(self.surface.enabled)
1237 self.surface.enabled = false;
1238 % if self.type.is.d2
1239 % self.plot.color = [];
1240 % else
1241 % self.plot3.color = [];
1242 % end
1243 elseif isempty(self.surface.enabled)
1244 self.surface.enabled = true;
1245 end
1246 proplist = ["plot", "plot3"];
1247 for prop = proplist
1248 if isprop(self, prop) && isempty(self.(prop).enabled)
1249 self.(prop).enabled = ~self.surface.enabled;
1250 end
1251 end
1252 end
1253
1254 %%%%
1255 %%%% Set heatmap settings.
1256 %%%%
1257
1258 if self.type.is.heatmap
1259 if ~isempty(self.precision) && ~isnumeric(self.precision)
1260 help("pm.vis.axes.Axes");
1261 disp("self.precision");
1262 disp( self.precision );
1263 error ( newline ...
1264 + "The specified precision must be a positive whole number." + newline ...
1265 + "For more information, see the documentation displayed above." + newline ...
1266 + newline ...
1267 );
1268 end
1269 self.setKeyVal(self.type.name, "colorbarVisible", "on");
1270 self.setKeyVal(self.type.name, "missingDataColor", "[0.1500 0.1500 0.1500]");
1271 end
1272
1273 %%%%
1274 %%%% Set histfit/histogram/histogram2/contour/contour3/contourf settings.
1275 %%%%
1276
1277 if self.type.is.histogram
1278 self.setKeyVal(self.type.name, "edgeColor", "none");
1279 end
1280
1281 if self.type.is.histfit
1282 self.setKeyVal(self.type.name, "dist", "Normal");
1283 self.setKeyVal(self.type.name, "nbins", []);
1284 end
1285
1286 if self.type.is.histogram2
1287 self.setKeyVal(self.type.name, "edgeColor", "none");
1288 self.setKeyVal(self.type.name, "displayStyle", "bar3");
1289 self.setKeyVal(self.type.name, "showEmptyBins", "off");
1290 %self.setKeyVal(self.type.name, "numbins", [100 100]);
1291 if ~self.colormap.enabled
1292 if ~pm.introspection.istype(self.histogram2.faceColor, "string", 1)
1293 self.setKeyVal(self.type.name, "faceColor", "auto");
1294 elseif self.histogram2.faceColor == "flat"
1295 % enforce monochrome by removing the colormapping.
1296 self.histogram2.faceColor = "auto";
1297 end
1298 else
1299 self.histogram2.faceColor = "flat";
1300 %self.setKeyVal(self.type.name, "faceColor", "flat");
1301 end
1302 end
1303
1304 if self.type.is.diffusion
1305 if self.type.is.contour3
1306 self.setKeyVal(self.type.name, "color", []);
1307 self.setKeyVal(self.type.name, "levels", 50);
1308 else
1309 if self.type.is.contourf
1310 self.setKeyVal(self.type.name, "color", "none");
1311 self.setKeyVal(self.type.name, "edgecolor", "none");
1312 self.setKeyVal(self.type.name, "levels", 50); % 8
1313 %if ~self.colormap.enabled && self.contourf.enabled
1314 % self.colormap.map = flipud(gray);
1315 %end
1316 else
1317 self.setKeyVal(self.type.name, "levels", 10); % 8
1318 self.setKeyVal(self.type.name, "color", []);
1319 end
1320 end
1321 self.setKeyVal("resolution", 2^9);
1322 self.setKeyVal("maxnoise", 0.001);
1323 self.setKeyVal(self.type.name, "labelSpacing", 144);
1324 self.setKeyVal(self.type.name, "showText", "off");
1325 self.setKeyVal(self.type.name, "lineStyle", "-");
1326 self.setKeyVal(self.type.name, "lineWidth", 0.5);
1327 end
1328
1329 %%%%
1330 %%%% Set line/scatter settings.
1331 %%%%
1332
1333 if self.type.is.scatter || self.type.is.lineScatter
1334 self.setKeyVal("scatter", "size", 5);
1335 self.setKeyVal("scatter", "marker", "o");
1336 self.setKeyVal("scatter", "filled", true);
1337 if self.type.is.lineScatter && (self.scatter.enabled || self.colormap.enabled)
1338 self.setKeyVal("plot", "color", uint8([200 200 200 150]));
1339 end
1340 end
1341
1342 if self.type.is.scatter3 || self.type.is.lineScatter3
1343 self.setKeyVal("scatter3", "size", 5);
1344 self.setKeyVal("scatter3", "marker", "o");
1345 self.setKeyVal("scatter3", "filled", true);
1346 if self.type.is.lineScatter3 && (self.scatter3.enabled || self.colormap.enabled)
1347 self.setKeyVal("plot3", "color", uint8([200 200 200 150]));
1348 end
1349 end
1350
1351 if self.type.has.line
1352 if self.type.is.d2; self.setKeyVal("plot", "lineWidth", 1); end
1353 if self.type.is.d3; self.setKeyVal("plot3", "lineWidth", 1); end
1354 self.setKeyVal("surface", "faceColor", "none");
1355 self.setKeyVal("surface", "edgeColor", "flat");
1356 self.setKeyVal("surface", "edgeAlpha", 0.5);
1357 self.setKeyVal("surface", "lineStyle", "-");
1358 self.setKeyVal("surface", "lineWidth", 1);
1359 self.setKeyVal("surface", "marker", "none");
1360 end
1361
1362 %%%%
1363 %%%% Set the coloring settings.
1364 %%%%
1365
1366 self.cenabled = false;
1367 self.cenabled = self.cenabled || (self.type.has.scatter && self.colormap.enabled);
1368 self.cenabled = self.cenabled || (self.type.has.line && self.surface.enabled && self.colormap.enabled);
1369 self.cenabled = self.cenabled || (self.type.is.histogram2 && self.colormap.enabled);
1370 self.cenabled = self.cenabled || (self.type.is.diffusion && self.colormap.enabled);
1371 self.cenabled = self.cenabled || (self.type.is.heatmap && self.colormap.enabled);
1372
1373 % if ~self.cenabled && self.type.has.line
1374 % if self.type.is.d2; self.plot.enabled = true; end
1375 % if self.type.is.d3; self.plot3.enabled = true; end
1376 % end
1377
1378 if isprop(self, "axes")
1379 if isfield(self.axes, "box") && isempty(self.axes.box); self.axes.box = "on"; end
1380 if isfield(self.axes, "xgrid") && isempty(self.axes.xgrid); self.axes.xgrid = "on"; end
1381 if isfield(self.axes, "ygrid") && isempty(self.axes.ygrid); self.axes.ygrid = "on"; end
1382 if isfield(self.axes, "zgrid") && isempty(self.axes.zgrid); self.axes.zgrid = "on"; end
1383 end
1384
1385 %if (self.type.is.diffusion || self.type.is.histogram2) && isempty(self.zlabel.txt)
1386 % self.zlabel.txt = "Density";
1387 %end
1388
1389 end % function
1390
1391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1392
1393 %> \brief
1394 %> Convert the components of the input component ``comp``
1395 %> of the parent object into a cell array of key-val pairs.<br>
1396 %>
1397 %> \details
1398 %> This is a dynamic method of the class [pm.vis.axes.Axes](@ref Axes).<br>
1399 %> This method is used internally by the subclasses to convert the parent object
1400 %> attributes to input arguments of MATLAB intrinsic visualization functions.<br>
1401 %>
1402 %> \param[inout] self : The input/output parent object of class [pm.vis.axes.Axes](@ref Axes)
1403 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
1404 %> \param[in] comp : The input scalar MATLAB string representing the name of a ``struct``
1405 %> component of the parent object, whose fields names and values are to
1406 %> be returned as subsequent pairs in the output ``hash`` cell array.<br>
1407 %>
1408 %> \return
1409 %> ``hash`` : The output cell array containing the pairs of ``field-name, field-value``
1410 %> of the input MATLAB struct ``comp``.<br>
1411 %>
1412 %> \interface{comp2hash}
1413 %> \code{.m}
1414 %>
1415 %> a = pm.vis.axes.Axes(ptype);
1416 %>
1417 %> hash = a.comp2hash(comp);
1418 %>
1419 %> \endcode
1420 %>
1421 %> \warning
1422 %> This method has side-effects by manipulating
1423 %> the existing attributes of the parent object.<br>
1424 %>
1425 %> \example{comp2hash}
1426 %> \code{.m}
1427 %>
1428 %> a = pm.vis.axes.Axes("line", "plot", {"linewidth", 2})
1429 %> hash = a.comp2hash("plot")
1430 %>
1431 %> \endcode
1432 %>
1433 %> \final{comp2hash}
1434 %>
1435 %> \author
1436 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
1437 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
1438 function hash = comp2hash(self, comp)
1439
1440 excludes = {"enabled"};
1441 if strcmp(comp, "axes")
1442 excludes = [excludes(:); "labels"; "parent"; "ncol"; "nrow"];
1443 elseif strcmp(comp, "colorbar")
1444 excludes = [excludes(:); "width"; "height"];
1445 elseif strcmp(comp, "colormap")
1446 excludes = [excludes(:); "map"];
1447 elseif strcmp(comp, "contour3") || strcmp(comp, "contourf") || strcmp(comp, "contour")
1448 % "color" is a keyword, but we set it as an explicit argument.
1449 excludes = [excludes(:); "levels"; "lineSpec"; "color"];
1450 %elseif strcmp(comp, "heatmap")
1451 % excludes = [excludes(:)];
1452 elseif strcmp(comp, "histfit")
1453 excludes = [excludes(:); "dist"; "nbins"];
1454 elseif strcmp(comp, "histogram")
1455 excludes = [excludes(:); "edges"; "nbins"];
1456 elseif strcmp(comp, "histogram2")
1457 excludes = [excludes(:); "nbins"; "xedges"; "yedges"];
1458 elseif strcmp(comp, "legend")
1459 excludes = [excludes(:); "labels"];
1460 elseif strcmp(comp, "plot") || strcmp(comp, "plot3")
1461 excludes = [excludes(:); "size"]; % color;
1462 elseif strcmp(comp, "scatter") || strcmp(comp, "scatter3")
1463 excludes = [excludes(:); "marker"; "filled"; "color"; "size"];
1464 elseif strcmp(comp, "surface")
1465 excludes = [excludes(:); "color"; "size"];
1466 elseif strcmp(comp, "title")
1467 excludes = [excludes(:); "titletext"; "subtitletext"];
1468 elseif strcmp(comp, "xlabel") || strcmp(comp, "ylabel") || strcmp(comp, "zlabel")
1469 excludes = [excludes(:); "txt"];
1470 elseif ~strcmp(comp, "heatmap")
1471 disp("comp");
1472 disp( comp );
1473 error ( newline ...
1474 + "Internal library error: Unrecognized MATLAB function name" + newline ...
1475 + "as ``comp`` argument of object of class [pm.vis.axes.Axes](@ref Axes)." + newline ...
1476 + newline ...
1477 );
1478 end
1479 unique = true;
1480 onlyfull = true;
1481 hash = pm.matlab.hashmap.struct2hash(self.(comp), excludes, unique, onlyfull);
1482 end
1483
1484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1485
1486 end
1487
1488 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1489
1490end
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared libraries.
function list()
Return a list of MATLAB strings containing the names of OS platforms supported by the ParaMonte MATLA...
This is the class for generating instances of objects that contain the specifications of various type...
Definition: Axes.m:622
function premake(in self, in varargin)
Configure the plot settings and specifications and return nothing.
function comp2hash(in self, in comp)
Convert the components of the input component comp of the parent object into a cell array of key-val ...
Property type
Definition: Axes.m:634
function Axes(in ptype, in varargin)
Construct and return an object of class pm.vis.axes.Axes.
Property cenabled
Definition: Axes.m:641
function reset(in self, in varargin)
Reset the properties of the plot to the original default settings and return nothing.
This is the base class for generating subclass of MATLAB handle superclass whose annoying methods are...
Definition: Handle.m:24
This is the SubplotContour3 class for generating instances of 3-dimensional Contour Subplot visualiza...
This is the SubplotContour class for generating instances of 2-dimensional Contour Subplot visualizat...
This is the SubplotContourf class for generating instances of 2-dimensional Contour Subplot visualiza...
This is the SubplotHeatmap class for generating instances of 2-dimensional Heatmap Subplot visualizat...
This is the SubplotHistfit class for generating instances of 2-dimensional Histfit Subplot visualizat...
This is the SubplotHistogram2 class for generating instances of 2-dimensional Histogram2 Subplot visu...
This is the SubplotHistogram class for generating instances of 1-dimensional Histogram Subplot visual...
This is the SubplotLine3 class for generating instances of 3-dimensional Line Subplot visualizations ...
Definition: SubplotLine3.m:26
This is the SubplotLineScatter3 class for generating instances of 3-dimensional Line-Scatter Subplot ...
This is the SubplotLineScatter class for generating instances of 2-dimensional Line-Scatter Subplot v...
This is the SubplotLine class for generating instances of 2-dimensional Line Subplot visualizations b...
Definition: SubplotLine.m:26
This is the SubplotScatter3 class for generating instances of 3-dimensional Scatter Subplot visualiza...
This is the SubplotScatter class for generating instances of 3-dimensional Scatter Subplot visualizat...
This is the abstract class for generating instances of axes with various types of plots from one or m...
Definition: Subplot.m:188
function clean()
Remove all paths that contain the ParaMonte lib directory from the MATLAB path variable.
function isnumeric(in str)
Return a scalar MATLAB logical that is true if and only if the input string can be converted to a sca...
function istype(in varval, in vartype, in varsize)
Return true if and only if the input varval conforms with the specified input type vartype and the sp...
function map()
Return a scalar MATLAB logical that is true if and only if the current installation of MATLAB contain...
function struct2hash(in object, in exkeys, in unique, in onlyfull)
Return a hashmap cell array containing all field names and field values of input scalar MATLAB object...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...