ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
Plot.m
Go to the documentation of this file.
1%> \brief
2%> This is the base class for generating instances of objects
3%> that contain the specifications of various types of figures.<br>
4%>
5%> \details
6%> This is a generic class for generating
7%> figures containing a **single** subplot (axes).<br>
8%>
9%> \note
10%> See the documentation of the constructor of the class
11%> [pm.vis.Plot](@ref Plot::Plot) for example usage.<br>
12%>
13%> \note
14%> See the documentation of the attributes
15%> of the superclass [pm.vis.figure.Figure](@ref Figure).<br>
16%>
17%> \see
18%> [pm.vis.Cascade](@ref Cascade)<br>
19%> [pm.vis.Subplot](@ref Subplot)<br>
20%> [pm.vis.Figure](@ref Figure)<br>
21%> [pm.vis.Corner](@ref Corner)<br>
22%> [pm.vis.Plot](@ref Plot)<br>
23%> [pm.vis.Tile](@ref Tile)<br>
24%>
25%> \final
26%>
27%> \AmirShahmoradi, July 5 2024, 1:07 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
28classdef Plot < pm.vis.figure.Figure
29
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31
32 properties(Access = public)
33 %>
34 %> ``subplot``
35 %>
36 %> The scalar object of superclass [pm.vis.Subplot](@ref Subplot)
37 %> representing the set of subplots to display in the figure.<br>
38 %>
39 subplot = [];
40 end
41
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43
44 methods(Access = public)
45
46 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47
48 %>
49 %> \param[in] subplot : The input scalar object of superclass [pm.vis.Subplot](@ref Subplot).<br>
50 %> The input ``subplot`` object must minimally have the ``make()`` and ``reset()`` methods.<br>
51 %> \param[in] varargin : Any ``property, value`` pair of the parent object.<br>
52 %> If the property is a ``struct()``, then its value must be given as a cell array,
53 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
54 %> Note that all of these property-value pairs can be also directly set via the
55 %> parent object attributes, before calling the ``make()`` method.<br>
56 %> The input ``varargin`` can also contain the components
57 %> of the ``subplot`` component of the parent object.<br>
58 %>
59 %> \return
60 %> ``self`` : The output scalar object of class [pm.vis.Plot](@ref Plot).<br>
61 %>
62 %> \interface{Plot}
63 %> \code{.m}
64 %>
65 %> plot = pm.vis.Plot(subplot);
66 %> plot = pm.vis.Plot(subplot, varargin);
67 %>
68 %> \endcode
69 %>
70 %> \note
71 %> The input ``varargin`` can also contain the components
72 %> of the ``subplot`` component of the parent object.<br>
73 %>
74 %> \note
75 %> See the list of class attributes below,
76 %> also those of the superclass [pm.vis.figure.Figure](@ref Figure).<br>
77 %>
78 %> \example{Plot}
79 %> \include{lineno} example/vis/Plot/main.m
80 %> \vis{Plot}
81 %> <br>\image html example/vis/Plot/PlotLine.1.png width=700
82 %> <br>\image html example/vis/Plot/PlotLine3.1.png width=700
83 %> <br>\image html example/vis/Plot/PlotScatter.1.png width=700
84 %> <br>\image html example/vis/Plot/PlotScatter3.1.png width=700
85 %> <br>\image html example/vis/Plot/PlotLineScatter.1.png width=700
86 %> <br>\image html example/vis/Plot/PlotLineScatter3.1.png width=700
87 %> <br>\image html example/vis/Plot/PlotHistfit.1.png width=700
88 %> <br>\image html example/vis/Plot/PlotHistogram.1.png width=700
89 %> <br>\image html example/vis/Plot/PlotHistogram2.1.png width=700
90 %> <br>\image html example/vis/Plot/PlotContour.1.png width=700
91 %> <br>\image html example/vis/Plot/PlotContourf.1.png width=700
92 %> <br>\image html example/vis/Plot/PlotContour3.1.png width=700
93 %> <br>\image html example/vis/Plot/PlotHeatmap.1.png width=700
94 %> <br>\image html example/vis/Plot/PlotEllipse3.1.png width=700
95 %> <br>\image html example/vis/Plot/PlotEllipse.1.png width=700
96 %>
97 %> \final{Plot}
98 %>
99 %> \author
100 %> \JoshuaOsborne, May 21 2024, 9:32 AM, University of Texas at Arlington<br>
101 %> \AmirShahmoradi, July 5 2024, 1:07 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
102 function self = Plot(subplot, varargin)
103 varargin = {"subplot", subplot, varargin{:}};
104 self = self@pm.vis.figure.Figure(varargin{:});
105 end
107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
108
109 %> \brief
110 %> Reset the properties of the plot to the original default settings.<br>
111 %>
112 %> \details
113 %> Use this method when you change many attributes of the plot and
114 %> you want to clean up and go back to the default settings.<br>
115 %>
116 %> \param[inout] self : The input/output parent object of class [pm.vis.Subplot](@ref Subplot)
117 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
118 %> \param[in] varargin : Any ``property, value`` pair of the parent object.<br>
119 %> If the property is a ``struct()``, then its value must be given as a cell array,
120 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
121 %> Note that all of these property-value pairs can be also directly set via the
122 %> parent object attributes, before calling the ``make()`` method.<br>
123 %>
124 %> \interface{reset}
125 %> \code{.m}
126 %>
127 %> pm.vis.Plot.reset() % reset the plot to the default settings.
128 %>
129 %> \endcode
130 %>
131 %> \note
132 %> The input ``varargin`` can also contain the components
133 %> of the ``subplot`` component of the parent object.<br>
134 %>
135 %> \final{reset}
136 %>
137 %> \author
138 %> \JoshuaOsborne, May 21 2024, 9:35 AM, University of Texas at Arlington<br>
139 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
140 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
141 function reset(self, varargin)
142
143 [varfig, varsub] = pm.matlab.hashmap.popKeyVal(["figure", "subplot"], varargin);
144 reset@pm.vis.figure.Figure(self, varfig{:});
145 self.subplot.reset(varsub{:});
147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
148 %%%% RULE 0: Any non-MATLAB-default setting must be preferably set in premake() method to override user null values.
149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150
151 end
152
153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154
155 %> \brief
156 %> Configure the plot settings and specifications,
157 %> make the plot, and return nothing.<br>
158 %>
159 %> \details
160 %> In making the figure, this method we call the ``make()`` methods of
161 %> each of the subplot objects stored in the ``subplot`` component.<br>
162 %>
163 %> \warning
164 %> This method has side-effects by manipulating
165 %> the existing attributes of the parent object.<br>
166 %>
167 %> \param[inout] self : The input/output parent object of class [pm.vis.Subplot](@ref Subplot)
168 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
169 %> \param[in] varargin : Any ``property, value`` pair of the parent object.<br>
170 %> If the property is a ``struct()``, then its value must be given as a cell array,
171 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
172 %> Note that all of these property-value pairs can be also directly set via the
173 %> parent object attributes, before calling the ``make()`` method.<br>
174 %>
175 %> \interface{make}
176 %> \code{.m}
177 %>
178 %> p = pm.vis.Plot.make(varargin);
179 %>
180 %> \endcode
181 %>
182 %> \note
183 %> The input ``varargin`` can also contain the components
184 %> of the ``subplot`` component of the parent object.<br>
185 %>
186 %> \example{Plot}
187 %> \include{lineno} example/vis/Plot/main.m
188 %> \vis{Plot}
189 %> <br>\image html example/vis/Plot/PlotLine.1.png width=700
190 %> <br>\image html example/vis/Plot/PlotLine3.1.png width=700
191 %> <br>\image html example/vis/Plot/PlotScatter.1.png width=700
192 %> <br>\image html example/vis/Plot/PlotScatter3.1.png width=700
193 %> <br>\image html example/vis/Plot/PlotLineScatter.1.png width=700
194 %> <br>\image html example/vis/Plot/PlotLineScatter3.1.png width=700
195 %> <br>\image html example/vis/Plot/PlotHistfit.1.png width=700
196 %> <br>\image html example/vis/Plot/PlotHistogram.1.png width=700
197 %> <br>\image html example/vis/Plot/PlotHistogram2.1.png width=700
198 %> <br>\image html example/vis/Plot/PlotContour.1.png width=700
199 %> <br>\image html example/vis/Plot/PlotContourf.1.png width=700
200 %> <br>\image html example/vis/Plot/PlotContour3.1.png width=700
201 %> <br>\image html example/vis/Plot/PlotHeatmap.1.png width=700
202 %> <br>\image html example/vis/Plot/PlotEllipse3.1.png width=700
203 %> <br>\image html example/vis/Plot/PlotEllipse.1.png width=700
204 %>
205 %> \final{make}
206 %>
207 %> \author
208 %> \JoshuaOsborne, May 21 2024, 9:37 AM, University of Texas at Arlington<br>
209 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
210 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
211 function make(self, varargin)
212
213 [varfig, varsub] = pm.matlab.hashmap.popKeyVal(["figure", "subplot"], varargin);
214 make@pm.vis.figure.Figure(self, varfig{:});
215 self.subplot.make(varsub{:});
216 if isprop(self.subplot, "axes") % Heatmap does not accept ``hold``.
217 hold off;
218 end
219
220 end % function
221
222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
223
224 end
225
226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
227
228 methods(Access = public, Hidden)
229
230 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231
232 %> \brief
233 %> Configure the plot settings and specifications and return nothing.<br>
234 %>
235 %> \warning
236 %> This method has side-effects by manipulating
237 %> the existing attributes of the parent object.<br>
238 %>
239 %> \param[inout] self : The input/output parent object of class [pm.vis.Subplot](@ref Subplot)
240 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
241 %> \param[in] varargin : Any ``property, value`` pair of the parent object.<br>
242 %> If the property is a ``struct()``, then its value must be given as a cell array,
243 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
244 %> Note that all of these property-value pairs can be also directly set via the
245 %> parent object attributes, before calling the ``premake()`` method.<br>
246 %>
247 %> \interface{premake}
248 %> \code{.m}
249 %>
250 %> f = pm.vis.Plot.premake(varargin);
251 %>
252 %> \endcode
253 %>
254 %> \example{getBorder}
255 %>
256 %> f = pm.vis.Plot(pm.vis.Line());
257 %> f.premake("figure", {"color", "none"})
258 %>
259 %> \final{premake}
260 %>
261 %> \author
262 %> \JoshuaOsborne, May 21 2024, 9:39 AM, University of Texas at Arlington<br>
263 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
264 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
265 function premake(self, varargin)
266
267 [varfig, varsub] = pm.matlab.hashmap.popKeyVal(["figure", "subplot"], varargin);
268 premake@pm.vis.figure.Figure(self, varfig{:});
269 if ~isempty(varsub)
270 self.subplot.hash2comp(varsub);
271 end
273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
274 %%%% These settings must happen here so that they can be reset every time user nullifies the values.
275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
276
277 end
278
279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
280
281 end
282
283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
284
285end
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 abstract class for generating instances of objects that contain the specifications of a c...
Definition: Cascade.m:32
This is the base class for generating instances of figures containing a symmetric square grid or corn...
Definition: Corner.m:19
This is the abstract class for generating instances of objects that contain the specifications of var...
Definition: Figure.m:27
This is the Contour3 class for generating instances of 3-dimensional Contour Plot visualizations base...
Definition: PlotContour3.m:30
This is the PlotContour class for generating instances of 2-dimensional Contour Plot visualizations b...
Definition: PlotContour.m:30
This is the PlotContourf class for generating instances of 2-dimensional Contourf Plot visualizations...
Definition: PlotContourf.m:30
This is the PlotEllipse3 class for generating instances of 3-dimensional Ellipse Plot visualizations ...
Definition: PlotEllipse3.m:29
This is the PlotEllipse class for generating instances of 2-dimensional Ellipse Plot visualizations b...
Definition: PlotEllipse.m:30
This is the PlotHeatmap class for generating instances of 2-dimensional Heatmap Plot visualizations b...
Definition: PlotHeatmap.m:30
This is the Histfit class for generating instances of 2-dimensional Histfit Plot visualizations based...
Definition: PlotHistfit.m:30
This is the PlotHistogram2 class for generating instances of 2-dimensional Histogram2 Plot visualizat...
This is the PlotHistogram class for generating instances of 1-dimensional Histogram Plot visualizatio...
Definition: PlotHistogram.m:30
This is the PlotLine3 class for generating instances of 3-dimensional Line Plot visualizations based ...
Definition: PlotLine3.m:30
This is the PlotLineScatter3 class for generating instances of 3-dimensional Line-Scatter Plot visual...
This is the PlotLineScatter class for generating instances of 2-dimensional Line-Scatter Plot visuali...
This is the PlotLine class for generating instances of 2-dimensional Line Plot visualizations based o...
Definition: PlotLine.m:30
This is the PlotScatter3 class for generating instances of 3-dimensional Scatter Plot visualizations ...
Definition: PlotScatter3.m:30
This is the PlotScatter class for generating instances of 2-dimensional Scatter Plot visualizations b...
Definition: PlotScatter.m:30
This is the base class for generating instances of objects that contain the specifications of various...
Definition: Plot.m:29
function premake(in self, in varargin)
Configure the plot settings and specifications and return nothing.
function reset(in self, in varargin)
Reset the properties of the plot to the original default settings.
Property subplot
Definition: Plot.m:42
function Plot(in subplot, in varargin)
function make(in self, in varargin)
Configure the plot settings and specifications, make the plot, and return nothing.
This is the abstract class for generating instances of axes with various types of plots from one or m...
Definition: Subplot.m:188
This is the abstract class for generating instances of objects that contain the specifications of var...
Definition: Tile.m:9
function clean()
Remove all paths that contain the ParaMonte lib directory from the MATLAB path variable.
function getBorder(in gramian, in center, in npnt)
Return a matrix of MATLAB doubles of shape [npnt, 2] containing the coordinates of a set of points on...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...