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 SubplotContour)/[pm.vis.SubplotContourf](@ref SubplotContourf)/[pm.vis.SubplotContour3](@ref SubplotContour3) 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 SubplotContour),
415%> [pm.vis.SubplotContourf](@ref SubplotContourf), [pm.vis.SubplotContour3](@ref SubplotContour3) 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 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 = public)
626 %>
627 %> ``silent``
628 %>
629 %> The scalar MATLAB logical (Boolean) indicator which is ``false`` by default.<br>
630 %> If it is set to ``true``, it will silence all output postprocessing
631 %> messages (except warnings and errors).<br>
632 %>
633 silent = false;
634 end
635
636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
637
638 properties(Access = public, Hidden)
639 %>
640 %> ``type``
641 %>
642 %> An auxiliary MATLAB ``struct`` containing plot type information.
643 %>
644 %> \warning
645 %> This is an internal ``Hidden`` class attribute
646 %> that is inaccessible to the end users.<br>
647 %>
648 type = struct();
649 %>
650 %> ``cenabled``
651 %>
652 %> An auxiliary scalar MATLAB ``logical`` that is true if plot is color-mapped.
653 %>
654 %> \warning
655 %> This is an internal ``Hidden`` class attribute
656 %> that is inaccessible to the end users.<br>
657 %>
658 cenabled = [];
659 end
660
661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
662
663 methods(Access = public)
664
665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
666
667 %> \brief
668 %> Construct and return an object of class [pm.vis.axes.Axes](@ref Axes).<br>
669 %>
670 %> \details
671 %> This function is the constructor of the class [pm.vis.axes.Axes](@ref Axes).<br>
672 %> For more information, see the documentation of the class [pm.vis.axes.Axes](@ref Axes).<br>
673 %>
674 %> \param[in] ptype : The input scalar MATLAB string containing the name of the
675 %> subclass that whose parent is Axes (e.g., "heatmap").<br>
676 %> Supported plot names are:<br>
677 %> <ol>
678 %> <li> ``"line"``
679 %> <li> ``"line3"``
680 %> <li> ``"scatter"``
681 %> <li> ``"scatter3"``
682 %> <li> ``"lineScatter"``
683 %> <li> ``"lineScatter3"``
684 %> <li> ``"histogram2"``
685 %> <li> ``"histogram"``
686 %> <li> ``"contour3"``
687 %> <li> ``"contourf"``
688 %> <li> ``"contour"``
689 %> <li> ``"histfit"``
690 %> <li> ``"heatmap"``
691 %> </ol>
692 %>
693 %> \param[in] varargin : Any ``property, value`` pair of the object.<br>
694 %> If the property is a ``struct()``, then its value must be given as a cell array,
695 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
696 %> Note that all of these property-value pairs can be also directly set via the
697 %> parent object attributes, before calling the ``premake()`` method.<br>
698 %>
699 %> \return
700 %> ``self`` : The output scalar object of class [pm.vis.axes.Axes](@ref Axes).<br>
701 %>
702 %> \interface{Axes}
703 %> \code{.m}
704 %>
705 %> axes = pm.vis.axes.Axes(ptype);
706 %>
707 %> \endcode
708 %>
709 %> \example{Axes}
710 %> \include{lineno} example/vis/axes/Axes/main.m
711 %> \output{Axes}
712 %> \include{lineno} example/vis/axes/Axes/main.out.m
713 %>
714 %> \final{Axes}
715 %>
716 %> \author
717 %> \JoshuaOsborne, May 21 2024, 5:59 AM, University of Texas at Arlington<br>
718 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
719 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
720 function self = Axes(ptype, varargin)
721
722 if nargin < 1 || ~pm.introspection.istype(ptype, "string", 1) || ~pm.array.len(ptype)
723 help("pm.vis.axes.Axes");
724 error ( newline ...
725 + "The input argument ``ptype`` is missing." + newline ...
726 + "For more information, see the class documentation displayed above." + newline ...
727 + newline ...
728 );
729 else
730 % lower the first character.
731 ptype = string(ptype);
732 ptype{1} = lower(ptype{1});
733 end
734
735 self.type = struct();
736 self.type.name = ptype;
737 pnamel = lower(ptype);
738 self.type.is.line = strcmpi(pnamel, "line" );
739 self.type.is.line3 = strcmpi(pnamel, "line3" );
740 self.type.is.scatter = strcmpi(pnamel, "scatter" );
741 self.type.is.scatter3 = strcmpi(pnamel, "scatter3" );
742 self.type.is.lineScatter = strcmpi(pnamel, "lineScatter" );
743 self.type.is.lineScatter3 = strcmpi(pnamel, "lineScatter3");
744 self.type.is.histogram2 = strcmpi(pnamel, "histogram2" );
745 self.type.is.histogram = strcmpi(pnamel, "histogram" );
746 self.type.is.contour3 = strcmpi(pnamel, "contour3" );
747 self.type.is.contourf = strcmpi(pnamel, "contourf" );
748 self.type.is.contour = strcmpi(pnamel, "contour" );
749 self.type.is.heatmap = strcmpi(pnamel, "heatmap" );
750 self.type.is.histfit = strcmpi(pnamel, "histfit" );
751 self.type.is.diffusion = self.type.is.contour || self.type.is.contourf || self.type.is.contour3;
752 self.type.is.density = self.type.is.diffusion || self.type.is.histfit || self.type.is.histogram || self.type.is.histogram2;
753 self.type.is.d3 = self.type.is.line3 || self.type.is.scatter3 || self.type.is.lineScatter3;
754 self.type.is.d1 = self.type.is.histfit || self.type.is.histogram || self.type.is.heatmap;
755 self.type.is.d2 = ~(self.type.is.d1 || self.type.is.d3);
756 self.type.is.triaxes = self.type.is.d3 || self.type.is.histogram2 || self.type.is.contour3;
757 %self.type.is.targetable = false; %xx ~self.type.is.heatmap && ~ self.type.is.d3;
758 self.type.has.line = self.type.is.line || self.type.is.line3 || self.type.is.lineScatter || self.type.is.lineScatter3;
759 self.type.has.scatter = self.type.is.scatter || self.type.is.scatter3 || self.type.is.lineScatter || self.type.is.lineScatter3;
760
761 self.reset(varargin{:}); % This is the subclass method!
762
763 end
764
765 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
766
767 %> \brief
768 %> Reset the properties of the plot to the original default settings and return nothing.<br>
769 %>
770 %> \details
771 %> Use this method when you change many attributes of the plot and
772 %> you want to clean up and go back to the default settings.<br>
773 %>
774 %> \param[inout] self : The input/output parent object of class [pm.vis.axes.Axes](@ref Axes)
775 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
776 %> \param[in] varargin : Any ``property, value`` pair of the parent object.<br>
777 %> If the property is a ``struct()``, then its value must be given as a cell array,
778 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
779 %> Note that all of these property-value pairs can be also directly set via the
780 %> parent object attributes.<br>
781 %>
782 %> \interface{reset}
783 %> \code{.m}
784 %>
785 %> a = pm.vis.axes.Axes(ptype)
786 %>
787 %> a.reset(varargin) % reset the plot to settings in ``varargin`` and the rest to default.
788 %> a.reset() % reset the plot to the default settings.
789 %>
790 %> \endcode
791 %>
792 %> \final{reset}
793 %>
794 %> \author
795 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
796 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
797 function reset(self, varargin)
798
799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
800 %%%% RULE 0: Any non-MATLAB-default setting must be preferably set in the premake() method to override user null values.
801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
802
803 fontSize_def = 12;
805 %%%%
806 %%%% axes
807 %%%%
808
809 if ~self.type.is.heatmap
810 self.newprop("axes", struct());
811 self.axes.box = [];
812 self.axes.color = [];
813 self.axes.colorScale = [];
814 self.axes.fontName = [];
815 self.axes.fontSize = fontSize_def;
816 self.axes.fontSizeMode = [];
817 self.axes.fontSmoothing = [];
818 self.axes.fontWeight = [];
819 self.axes.xgrid = [];
820 self.axes.ygrid = [];
821 if self.type.is.triaxes
822 self.axes.zgrid = [];
823 end
824 self.axes.enabled = [];
825 end
826
827 %%%%
828 %%%% title
829 %%%%
830
831 self.newprop("title", struct());
832 if ~self.type.is.heatmap
833 self.title.fontSize = fontSize_def;
834 self.title.interpreter = [];
835 self.title.fontWeight = [];
836 self.title.color = []; %[0, 0, 0];
837 end
838 self.title.enabled = [];
839 self.title.titletext = [];
840 if ~self.type.is.heatmap
841 self.title.subtitletext = [];
842 end
843
844 %%%%
845 %%%% xlabel, xlim
846 %%%%
847
848 self.newprop("xlabel", struct());
849 if ~self.type.is.heatmap
850 self.xlabel.color = []; %[0.15, 0.15, 0.15];
851 self.xlabel.fontAngle = [];
852 self.xlabel.fontSize = fontSize_def;
853 self.xlabel.fontWeight = [];
854 self.xlabel.interpreter = [];
855 self.xlabel.rotation = [];
856 self.newprop("xscale", []);
857 self.newprop("xlim", []);
858 end
859 self.xlabel.enabled = [];
860 self.xlabel.txt = [];
861
862 %%%%
863 %%%% ylabel, ylim
864 %%%%
865
866 self.newprop("ylabel", self.xlabel);
867 if ~self.type.is.heatmap
868 self.newprop("yscale", []);
869 self.newprop("ylim", []);
870 end
871
872 %%%%
873 %%%% zlabel, zlim
874 %%%%
875
876 if self.type.is.triaxes
877 self.newprop("zlabel", self.xlabel);
878 self.newprop("zlim", []);
879 self.newprop("zscale", []);
880 end
881
882 %%%%
883 %%%% colc, colorbar, colormap
884 %%%%
885
886 if self.type.is.heatmap || ~self.type.is.d1
887
888 if self.type.has.line || self.type.has.scatter
889 self.newprop("colc", {});
890 end
891
892 if ~self.type.is.heatmap
893 self.newprop("colorbar", struct());
894 self.colorbar.fontSize = fontSize_def;
895 self.colorbar.direction = 'normal';
896 self.colorbar.limits = [];
897 self.colorbar.location = 'eastoutside';
898 self.colorbar.ticks = [];
899 self.colorbar.tickLabels = [];
900 self.colorbar.tickLabelInterpreter = 'tex';
901 self.colorbar.enabled = [];
902 end
903
904 self.newprop("colormap", struct());
905 self.colormap.enabled = [];
906 self.colormap.map = []; % 'default'
907
908 end
909
910 %%%%
911 %%%% legend
912 %%%%
913
914 if ~self.type.is.heatmap
915 self.newprop("legend", struct());
916 self.legend.box = 'off';
917 self.legend.color = 'none';
918 self.legend.fontSize = fontSize_def;
919 self.legend.interpreter = 'none';
920 self.legend.location = [];
921 self.legend.numColumns = [];
922 self.legend.textColor = [];
923 self.legend.enabled = [];
924 self.legend.labels = {};
925 end
926
927 %%%%
928 %%%% target
929 %%%%
930
931 %if ~self.type.is.targetable
932 % self.newprop("target");
933 %end
934
935 %%%%
936 %%%% heatmap attributes
937 %%%%
938
939 if self.type.is.heatmap
940 self.newprop("heatmap", struct());
941 self.newprop("precision", []);
942 self.heatmap.colorbarVisible = [];
943 self.heatmap.colorLimits = [];
944 self.heatmap.missingDataColor = [];
945 self.heatmap.fontName = [];
946 self.heatmap.fontSize = fontSize_def;
947 self.heatmap.enabled = [];
948 end
949
950 %%%%
951 %%%% density attributes
952 %%%%
953
954 if self.type.is.histfit
955 self.newprop("histfit", struct());
956 self.histfit.enabled = [];
957 self.histfit.dist = [];
958 self.histfit.nbins = [];
959 end
960
961 if self.type.is.histogram
962 self.newprop("histogram", struct());
963 self.histogram.binLimitsMode = [];
964 self.histogram.binMethod = [];
965 self.histogram.binWidth = [];
966 self.histogram.displayStyle = [];
967 self.histogram.edgeAlpha = [];
968 self.histogram.edgeColor = [];
969 self.histogram.faceAlpha = [];
970 self.histogram.faceColor = [];
971 self.histogram.lineStyle = [];
972 self.histogram.lineWidth = [];
973 self.histogram.normalization = [];
974 self.histogram.orientation = [];
975 self.histogram.enabled = [];
976 self.histogram.edges = [];
977 self.histogram.nbins = [];
978 end
979
980 if self.type.is.histogram2
981 self.newprop("histogram2", struct());
982 self.histogram2.binWidth = [];
983 self.histogram2.xbinLimits = [];
984 self.histogram2.xbinLimitsMode = [];
985 self.histogram2.ybinLimits = [];
986 self.histogram2.ybinLimitsMode = [];
987 self.histogram2.binMethod = [];
988 self.histogram2.showEmptyBins = [];
989 self.histogram2.normalization = [];
990 self.histogram2.displayStyle = [];
991 self.histogram2.edgeAlpha = [];
992 self.histogram2.edgeColor = [];
993 self.histogram2.faceAlpha = [];
994 self.histogram2.faceColor = [];
995 self.histogram2.faceLighting = [];
996 self.histogram2.lineStyle = [];
997 self.histogram2.lineWidth = [];
998 self.histogram2.enabled = [];
999 self.histogram2.nbins = [];
1000 self.histogram2.xedges = [];
1001 self.histogram2.yedges = [];
1002 end
1003
1004 if self.type.is.contour || self.type.is.contourf || self.type.is.contour3
1005 self.newprop("resolution", 2^9);
1006 self.newprop("maxnoise", 0.001);
1007 end
1008
1009 if self.type.is.contour
1010 self.newprop("contour", struct());
1011 self.contour.color = [];
1012 self.contour.labelSpacing = [];
1013 self.contour.lineWidth = [];
1014 self.contour.showText = [];
1015 self.contour.enabled = [];
1016 self.contour.levels = [];
1017 self.contour.lineSpec = [];
1018 end
1019
1020 if self.type.is.contourf
1021 self.newprop("contourf", struct());
1022 self.contourf.edgecolor = [];
1023 self.contourf.color = [];
1024 self.contourf.labelSpacing = [];
1025 self.contourf.lineWidth = [];
1026 self.contourf.showText = [];
1027 self.contourf.enabled = [];
1028 self.contourf.levels = [];
1029 self.contourf.lineSpec = [];
1030 end
1031
1032 if self.type.is.contour3
1033 self.newprop("contour3", struct());
1034 self.contour3.color = [];
1035 self.contour3.labelSpacing = [];
1036 self.contour3.lineWidth = [];
1037 self.contour3.showText = [];
1038 self.contour3.enabled = [];
1039 self.contour3.levels = [];
1040 self.contour3.lineSpec = [];
1041 end
1042
1043 %%%%
1044 %%%% line/scatter attributes
1045 %%%%
1046
1047 if self.type.is.line || self.type.is.lineScatter
1048 self.newprop("surface", struct());
1049 self.newprop("plot", struct());
1050 self.plot.color = [];
1051 self.plot.lineWidth = [];
1052 self.plot.lineStyle = [];
1053 self.plot.markeredgeColor = [];
1054 self.plot.markerFaceColor = [];
1055 self.plot.markerIndices = [];
1056 self.plot.markerSize = [];
1057 self.plot.enabled = [];
1058 end
1059
1060 if self.type.is.line3 || self.type.is.lineScatter3
1061 self.newprop("surface", struct());
1062 self.newprop("plot3", struct());
1063 self.plot3.color = {};
1064 self.plot3.lineWidth = {};
1065 self.plot3.lineStyle = '-';
1066 self.plot3.markeredgeColor = [];
1067 self.plot3.markerFaceColor = [];
1068 self.plot3.markerIndices = [];
1069 self.plot3.markerSize = [];
1070 self.plot3.enabled = [];
1071 end
1072
1073 if isprop(self, "surface")
1074 self.surface.alignVertexCenters = {};
1075 self.surface.backFaceLighting = {};
1076 self.surface.edgeAlpha = {};
1077 self.surface.edgeColor = {};
1078 self.surface.edgeLighting = {};
1079 self.surface.faceAlpha = {};
1080 self.surface.faceColor = {};
1081 self.surface.faceLighting = {};
1082 self.surface.lineStyle = {};
1083 self.surface.lineWidth = {};
1084 self.surface.marker = {};
1085 self.surface.markerEdgeColor = {};
1086 self.surface.markerFaceColor = {};
1087 self.surface.markerSize = {};
1088 self.surface.meshStyle = {};
1089 self.surface.enabled = [];
1090 end
1091
1092 if self.type.is.scatter || self.type.is.lineScatter
1093 self.newprop("scatter", struct());
1094 self.scatter.colorVariable = [];
1095 self.scatter.lineWidth = [];
1096 self.scatter.markeredgeColor = [];
1097 self.scatter.markerFaceColor = [];
1098 self.scatter.enabled = [];
1099 self.scatter.color = [];
1100 self.scatter.filled = [];
1101 self.scatter.marker = [];
1102 self.scatter.size = [];
1103 end
1104
1105 if self.type.is.scatter3 || self.type.is.lineScatter3
1106 self.newprop("scatter3", struct());
1107 self.scatter3.colorVariable = [];
1108 self.scatter3.lineWidth = [];
1109 self.scatter3.markeredgeColor = [];
1110 self.scatter3.markerFaceColor = [];
1111 self.scatter3.enabled = [];
1112 self.scatter3.color = [];
1113 self.scatter3.filled = [];
1114 self.scatter3.marker = [];
1115 self.scatter3.size = [];
1116 end
1117
1118 %if self.type.is.targetable
1119 % self.target = pm.vis.Target();
1120 %end
1121
1122 if ~isempty(varargin)
1123 self.hash2comp(varargin); % parse arguments
1124 end
1125 %self.premake(varargin{:}); % This is the subclass method!
1126
1127 end
1128
1129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1130
1131 end
1132
1133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1134
1135 methods(Access = public, Hidden)
1136
1137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1138
1139 %> \brief
1140 %> Configure the plot settings and specifications and return nothing.<br>
1141 %>
1142 %> \param[inout] self : The input/output parent object of class [pm.vis.axes.Axes](@ref Axes)
1143 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
1144 %> \param[in] varargin : Any ``property, value`` pair of the parent object.<br>
1145 %> If the property is a ``struct()``, then its value must be given as a cell array,
1146 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
1147 %> Note that all of these property-value pairs can be also directly set via the
1148 %> parent object attributes, before calling the ``premake()`` method.<br>
1149 %>
1150 %> \interface{premake}
1151 %> \code{.m}
1152 %>
1153 %> a = pm.vis.axes.Axes(ptype);
1154 %>
1155 %> a.premake(varargin);
1156 %> a.premake();
1157 %>
1158 %> \endcode
1159 %>
1160 %> \warning
1161 %> This method has side-effects by manipulating
1162 %> the existing attributes of the parent object.<br>
1163 %>
1164 %> \example{premake}
1165 %> \code{.m}
1166 %>
1167 %> a = pm.vis.axes.Axes("line");
1168 %> a.premake("xlim", [0, 1])
1169 %>
1170 %> \endcode
1171 %>
1172 %> \final{premake}
1173 %>
1174 %> \author
1175 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
1176 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
1177 function premake(self, varargin)
1178
1179 if ~isempty(varargin)
1180 self.hash2comp(varargin); % parse arguments
1181 end
1182
1183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1184 %%%% These settings must happen here so that they can be reset every time user nullifies the values.
1185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1186
1187 %%%%
1188 %%%% Set the enabled visualization components.
1189 %%%%
1190
1191 if isprop(self, "axes") && isempty(self.axes.enabled)
1192 self.axes.enabled = true;
1193 end
1194
1195 if isprop(self, "title") && isempty(self.title.enabled)
1196 self.title.enabled = ~isempty(self.title.titletext);
1197 end
1198
1199 if isprop(self, "xlabel") && isempty(self.xlabel.enabled)
1200 self.xlabel.enabled = true;
1201 end
1202
1203 if isprop(self, "ylabel") && isempty(self.ylabel.enabled)
1204 self.ylabel.enabled = true;
1205 end
1206
1207 if isprop(self, "zlabel") && isempty(self.zlabel.enabled)
1208 self.zlabel.enabled = true;
1209 end
1210
1211 if isprop(self, "colorbar") && isempty(self.colorbar.enabled)
1212 self.colorbar.enabled = true;
1213 end
1214
1215 if isprop(self, "colormap") && isempty(self.colormap.enabled)
1216 self.colormap.enabled = true;
1217 end
1218
1219 if isprop(self, "contour") && isempty(self.contour.enabled)
1220 self.contour.enabled = true;
1221 end
1222
1223 if isprop(self, "contourf") && isempty(self.contourf.enabled)
1224 self.contourf.enabled = true;
1225 end
1226
1227 if isprop(self, "contour3") && isempty(self.contour3.enabled)
1228 self.contour3.enabled = true;
1229 end
1230
1231 if isprop(self, "heatmap") && isempty(self.heatmap.enabled)
1232 self.heatmap.enabled = true;
1233 end
1234
1235 if isprop(self, "histfit") && isempty(self.histfit.enabled)
1236 self.histfit.enabled = true;
1237 end
1238
1239 if isprop(self, "histogram") && isempty(self.histogram.enabled)
1240 self.histogram.enabled = true;
1241 end
1242
1243 if isprop(self, "histogram2") && isempty(self.histogram2.enabled)
1244 self.histogram2.enabled = true;
1245 end
1246
1247 if isprop(self, "legend") && isempty(self.legend.enabled)
1248 self.legend.enabled = false;
1249 end
1250
1251 if isprop(self, "plot") && isempty(self.plot.enabled)
1252 self.plot.enabled = true;
1253 end
1254
1255 if isprop(self, "plot3") && isempty(self.plot3.enabled)
1256 self.plot3.enabled = true;
1257 end
1258
1259 if isprop(self, "scatter") && isempty(self.scatter.enabled)
1260 self.scatter.enabled = true;
1261 end
1262
1263 if isprop(self, "scatter3") && isempty(self.scatter3.enabled)
1264 self.scatter3.enabled = true;
1265 end
1266
1267 %%%%
1268 %%%% ensure line plots are monochromatic when there is scatter plot.
1269 %%%%
1270
1271 if self.type.has.line
1272 if self.type.has.scatter && isempty(self.surface.enabled)
1273 self.surface.enabled = false;
1274 % if self.type.is.d2
1275 % self.plot.color = [];
1276 % else
1277 % self.plot3.color = [];
1278 % end
1279 elseif isempty(self.surface.enabled)
1280 self.surface.enabled = true;
1281 end
1282 proplist = ["plot", "plot3"];
1283 for prop = proplist
1284 if isprop(self, prop) && isempty(self.(prop).enabled)
1285 self.(prop).enabled = ~self.surface.enabled;
1286 end
1287 end
1288 end
1289
1290 %%%%
1291 %%%% Set heatmap settings.
1292 %%%%
1293
1294 if self.type.is.heatmap
1295 if ~isempty(self.precision) && ~isnumeric(self.precision)
1296 help("pm.vis.axes.Axes");
1297 disp("self.precision");
1298 disp( self.precision );
1299 error ( newline ...
1300 + "The specified precision must be a positive whole number." + newline ...
1301 + "For more information, see the documentation displayed above." + newline ...
1302 + newline ...
1303 );
1304 end
1305 self.setKeyVal(self.type.name, "colorbarVisible", "on");
1306 self.setKeyVal(self.type.name, "missingDataColor", "[0.1500 0.1500 0.1500]");
1307 end
1308
1309 %%%%
1310 %%%% Set histfit/histogram/histogram2/contour/contour3/contourf settings.
1311 %%%%
1312
1313 if self.type.is.histogram
1314 self.setKeyVal(self.type.name, "edgeColor", "none");
1315 end
1316
1317 if self.type.is.histfit
1318 self.setKeyVal(self.type.name, "dist", "Normal");
1319 self.setKeyVal(self.type.name, "nbins", []);
1320 end
1321
1322 if self.type.is.histogram2
1323 self.setKeyVal(self.type.name, "edgeColor", "none");
1324 self.setKeyVal(self.type.name, "displayStyle", "bar3");
1325 self.setKeyVal(self.type.name, "showEmptyBins", "off");
1326 %self.setKeyVal(self.type.name, "numbins", [100 100]);
1327 if ~self.colormap.enabled
1328 if ~pm.introspection.istype(self.histogram2.faceColor, "string", 1)
1329 self.setKeyVal(self.type.name, "faceColor", "auto");
1330 elseif self.histogram2.faceColor == "flat"
1331 % enforce monochrome by removing the colormapping.
1332 self.histogram2.faceColor = "auto";
1333 end
1334 else
1335 self.histogram2.faceColor = "flat";
1336 %self.setKeyVal(self.type.name, "faceColor", "flat");
1337 end
1338 end
1339
1340 if self.type.is.diffusion
1341 if self.type.is.contour3
1342 self.setKeyVal(self.type.name, "color", []);
1343 self.setKeyVal(self.type.name, "levels", 50);
1344 else
1345 if self.type.is.contourf
1346 self.setKeyVal(self.type.name, "color", "none");
1347 self.setKeyVal(self.type.name, "edgecolor", "none");
1348 self.setKeyVal(self.type.name, "levels", 50); % 8
1349 %if ~self.colormap.enabled && self.contourf.enabled
1350 % self.colormap.map = flipud(gray);
1351 %end
1352 else
1353 self.setKeyVal(self.type.name, "levels", 10); % 8
1354 self.setKeyVal(self.type.name, "color", []);
1355 end
1356 end
1357 self.setKeyVal("resolution", 2^9);
1358 self.setKeyVal("maxnoise", 0.001);
1359 self.setKeyVal(self.type.name, "labelSpacing", 144);
1360 self.setKeyVal(self.type.name, "showText", "off");
1361 self.setKeyVal(self.type.name, "lineStyle", "-");
1362 self.setKeyVal(self.type.name, "lineWidth", 0.5);
1363 end
1364
1365 %%%%
1366 %%%% Set line/scatter settings.
1367 %%%%
1368
1369 if self.type.is.scatter || self.type.is.lineScatter
1370 self.setKeyVal("scatter", "size", 5);
1371 self.setKeyVal("scatter", "marker", "o");
1372 self.setKeyVal("scatter", "filled", true);
1373 if self.type.is.lineScatter && (self.scatter.enabled || self.colormap.enabled)
1374 self.setKeyVal("plot", "color", uint8([200 200 200 150]));
1375 end
1376 end
1377
1378 if self.type.is.scatter3 || self.type.is.lineScatter3
1379 self.setKeyVal("scatter3", "size", 5);
1380 self.setKeyVal("scatter3", "marker", "o");
1381 self.setKeyVal("scatter3", "filled", true);
1382 if self.type.is.lineScatter3 && (self.scatter3.enabled || self.colormap.enabled)
1383 self.setKeyVal("plot3", "color", uint8([200 200 200 150]));
1384 end
1385 end
1386
1387 if self.type.has.line
1388 if self.type.is.d2; self.setKeyVal("plot", "lineWidth", 1); end
1389 if self.type.is.d3; self.setKeyVal("plot3", "lineWidth", 1); end
1390 self.setKeyVal("surface", "faceColor", "none");
1391 self.setKeyVal("surface", "edgeColor", "flat");
1392 self.setKeyVal("surface", "edgeAlpha", 0.5);
1393 self.setKeyVal("surface", "lineStyle", "-");
1394 self.setKeyVal("surface", "lineWidth", 1);
1395 self.setKeyVal("surface", "marker", "none");
1396 end
1397
1398 %%%%
1399 %%%% Set the coloring settings.
1400 %%%%
1401
1402 self.cenabled = false;
1403 self.cenabled = self.cenabled || (self.type.has.scatter && self.colormap.enabled);
1404 self.cenabled = self.cenabled || (self.type.has.line && self.surface.enabled && self.colormap.enabled);
1405 self.cenabled = self.cenabled || (self.type.is.histogram2 && self.colormap.enabled);
1406 self.cenabled = self.cenabled || (self.type.is.diffusion && self.colormap.enabled);
1407 self.cenabled = self.cenabled || (self.type.is.heatmap && self.colormap.enabled);
1408
1409 % if ~self.cenabled && self.type.has.line
1410 % if self.type.is.d2; self.plot.enabled = true; end
1411 % if self.type.is.d3; self.plot3.enabled = true; end
1412 % end
1413
1414 if isprop(self, "axes")
1415 if isfield(self.axes, "box") && isempty(self.axes.box); self.axes.box = "on"; end
1416 if isfield(self.axes, "xgrid") && isempty(self.axes.xgrid); self.axes.xgrid = "on"; end
1417 if isfield(self.axes, "ygrid") && isempty(self.axes.ygrid); self.axes.ygrid = "on"; end
1418 if isfield(self.axes, "zgrid") && isempty(self.axes.zgrid); self.axes.zgrid = "on"; end
1419 end
1420
1421 %if (self.type.is.diffusion || self.type.is.histogram2) && isempty(self.zlabel.txt)
1422 % self.zlabel.txt = "Density";
1423 %end
1424
1425 end % function
1426
1427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1428
1429 %> \brief
1430 %> Convert the components of the input component ``comp``
1431 %> of the parent object into a cell array of key-val pairs.<br>
1432 %>
1433 %> \details
1434 %> This is a dynamic method of the class [pm.vis.axes.Axes](@ref Axes).<br>
1435 %> This method is used internally by the subclasses to convert the parent object
1436 %> attributes to input arguments of MATLAB intrinsic visualization functions.<br>
1437 %>
1438 %> \param[inout] self : The input/output parent object of class [pm.vis.axes.Axes](@ref Axes)
1439 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
1440 %> \param[in] comp : The input scalar MATLAB string representing the name of a ``struct``
1441 %> component of the parent object, whose fields names and values are to
1442 %> be returned as subsequent pairs in the output ``hash`` cell array.<br>
1443 %>
1444 %> \return
1445 %> ``hash`` : The output cell array containing the pairs of ``field-name, field-value``
1446 %> of the input MATLAB struct ``comp``.<br>
1447 %>
1448 %> \interface{comp2hash}
1449 %> \code{.m}
1450 %>
1451 %> a = pm.vis.axes.Axes(ptype);
1452 %>
1453 %> hash = a.comp2hash(comp);
1454 %>
1455 %> \endcode
1456 %>
1457 %> \warning
1458 %> This method has side-effects by manipulating
1459 %> the existing attributes of the parent object.<br>
1460 %>
1461 %> \example{comp2hash}
1462 %> \code{.m}
1463 %>
1464 %> a = pm.vis.axes.Axes("line", "plot", {"linewidth", 2})
1465 %> hash = a.comp2hash("plot")
1466 %>
1467 %> \endcode
1468 %>
1469 %> \final{comp2hash}
1470 %>
1471 %> \author
1472 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
1473 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
1474 function hash = comp2hash(self, comp)
1475
1476 excludes = {"enabled"};
1477 if strcmp(comp, "axes")
1478 excludes = [excludes(:); "labels"; "parent"; "ncol"; "nrow"];
1479 elseif strcmp(comp, "colorbar")
1480 excludes = [excludes(:); "width"; "height"];
1481 elseif strcmp(comp, "colormap")
1482 excludes = [excludes(:); "map"];
1483 elseif strcmp(comp, "contour3") || strcmp(comp, "contourf") || strcmp(comp, "contour")
1484 % "color" is a keyword, but we set it as an explicit argument.
1485 excludes = [excludes(:); "levels"; "lineSpec"; "color"];
1486 %elseif strcmp(comp, "heatmap")
1487 % excludes = [excludes(:)];
1488 elseif strcmp(comp, "histfit")
1489 excludes = [excludes(:); "dist"; "nbins"];
1490 elseif strcmp(comp, "histogram")
1491 excludes = [excludes(:); "edges"; "nbins"];
1492 elseif strcmp(comp, "histogram2")
1493 excludes = [excludes(:); "nbins"; "xedges"; "yedges"];
1494 elseif strcmp(comp, "legend")
1495 excludes = [excludes(:); "labels"];
1496 elseif strcmp(comp, "plot") || strcmp(comp, "plot3")
1497 excludes = [excludes(:); "size"]; % color;
1498 elseif strcmp(comp, "scatter") || strcmp(comp, "scatter3")
1499 excludes = [excludes(:); "marker"; "filled"; "color"; "size"];
1500 elseif strcmp(comp, "surface")
1501 excludes = [excludes(:); "color"; "size"];
1502 elseif strcmp(comp, "title")
1503 excludes = [excludes(:); "titletext"; "subtitletext"];
1504 elseif strcmp(comp, "xlabel") || strcmp(comp, "ylabel") || strcmp(comp, "zlabel")
1505 excludes = [excludes(:); "txt"];
1506 elseif ~strcmp(comp, "heatmap")
1507 disp("comp");
1508 disp( comp );
1509 error ( newline ...
1510 + "Internal library error: Unrecognized MATLAB function name" + newline ...
1511 + "as ``comp`` argument of object of class [pm.vis.axes.Axes](@ref Axes)." + newline ...
1512 + newline ...
1513 );
1514 end
1515 unique = true;
1516 onlyfull = true;
1517 hash = pm.matlab.hashmap.struct2hash(self.(comp), excludes, unique, onlyfull);
1518 end
1519
1520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1521
1522 end
1523
1524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1525
1526end
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared library directories.
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
Property silent
Definition: Axes.m:636
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:652
function Axes(in ptype, in varargin)
Construct and return an object of class pm.vis.axes.Axes.
Property cenabled
Definition: Axes.m:663
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...