2%> This is the base
class for generating instances
3%> of figures containing a symmetric square grid or corner of subplots.<br>
6%> See the
list of
class attributes below,
7%> also those of the superclass [pm.vis.Tiling](@ref
Tiling).<br>
10%> See also the documentation of the constructor of the
class [pm.vis.Corner::Corner](@ref
Corner::Corner).<br>
15%> \JoshuaOsborne, May 21 2024, 9:20 AM, University of Texas at Arlington<br>
16%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
17%> \AmirShahmoradi, July 7 2024, 12:53 AM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22 properties(Access =
public, Hidden)
26 % % A scalar
object of
class [pm.data.DataFrame](@ref
DataFrame)
27 % % containing the user-specified data to visualize.
33 % A numeric vector that serves as a storage
for an arbitrary subset of indices
34 % of the rows of the input dataframe reference ``dfref`` to the
class constructor .
38 % 1. a numeric range, or,
39 % 2. a
list of row indices of the ``dfref``.
43 % 1. rows = 15 : -2 : 8
44 % 2. rows = [12, 46, 7, 8, 9, 4, 7, 163]
46 % If ``rows`` is empty, the
default will be set by the
template subplots
47 % specified in the components ``diag``, ``lower``, and ``upper`` of the
48 % parent corner
object.
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 properties(Access =
public)
57 %> ``cols`` (standing
for columns)
59 %> The vector of MATLAB integers or names of of the input dataframe columns
60 %> that determines the columns of the specified dataframe to visualize.
61 %> It can have multiple forms:<br>
62 %> 1. a numeric or cell array of column indices in the input ``dfref``.
63 %> 2. a
string or cell array of column names in ``dfref.Properties.VariableNames``.
64 %> 3. a cell array of a mix of the above two.
65 %> 4. a numeric range.<br>
67 %> 1. self.cols = [7, 8, 9]
68 %> 2. self.cols = [
"sampleLogFunc",
"sampleVariable1"]
69 %> 3. self.cols = {
"sampleLogFunc", 9,
"sampleVariable1"}
70 %> 4. self.cols = 7:9 # every column in the data frame starting from column #7 to #9
71 %> 5. self.cols = 7:2:20 # every other column in the data frame starting from column #7 to #20
72 %> The ``i``th element of the specified ``cols`` will be used as value
for:<br>
73 %> 1. the ``i``th column of data to visualize on the x-axis in subplot ``subplot{i, i}``.<br>
74 %> 1. the ``i``th column of data to visualize on the x-axis in subplot ``subplot{i, :}``.<br>
75 %> 1. the ``i``th column of data to visualize on the y-axis in subplot ``subplot{:, i}``.<br>
76 %> If ``cols`` is empty, no visualizations will be made.
82 %> The scalar
object of superclass [pm.vis.Subplot](@ref
Subplot)
83 %> representing the
template of the diagonal subplots to display.<br>
84 %> Note that only the visualization properties of the
template are used.<br>
85 %> The data properties of the
template are set by the ``make()`` method.<br>
86 %> (**optional**. The
default value is [pm.vis.SubplotHistogram](@ref
SubplotHistogram).)
88 diag = pm.vis.SubplotHistogram();
92 %> The scalar
object of superclass [pm.vis.Subplot](@ref
Subplot)
93 %> representing the
template of the lower-triangle subplots to display.<br>
94 %> The data properties of the
template are set by the ``make()`` method.<br>
95 %> (**optional**. The
default value is [pm.vis.SubplotContour](@ref
SubplotContour).)
97 lower = pm.vis.SubplotContour();
101 %> The scalar
object of superclass [pm.vis.Subplot](@ref
Subplot)
102 %> representing the
template of the upper-triangle subplots to display.<br>
103 %> The data properties of the
template are set by the ``make()`` method.<br>
104 %> (**optional**. The
default value is [pm.vis.SubplotLineScatter](@ref
SubplotLineScatter).)
106 upper = pm.vis.SubplotLineScatter();
109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 methods(Access =
public)
113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
116 %> Generate an
return an
object of
class [pm.vis.Corner](@ref
Corner).<br>
119 %> This is the constructor of the
class [pm.vis.Corner](@ref
Corner).<br>
121 %> \param[in] dfref : See the documentation of the corresponding input
122 %> argument of the
class [pm.vis.Subplot](@ref
Subplot).<br>
123 %> (**optional**.
default = ``table(zeros(0, 0))``)
125 %> \param[in] varargin : Any ``property, value`` pair of the parent
object.<br>
126 %> If the property is a ``
struct()``, then its value must be given as a cell array,
127 %> with consecutive elements representing the
struct ``property-
name, property-value`` pairs.<br>
128 %> Note that all of these
property-value pairs can be also directly set via the
129 %> parent
object attributes, before calling the ``make()`` method.<br>
132 %> ``self`` : The output scalar
object of
class [pm.vis.Corner](@ref
Corner).
137 %> plot = pm.vis.
Corner(subplot);
142 %> See the
list of
class attributes below,
143 %> also those of the superclass [pm.vis.Tiling](@ref
Tiling).
148 %> \JoshuaOsborne, May 22 2024, 9:39 PM, University of Texas at Arlington<br>
149 function self =
Corner(df, varargin)
159 self = self@pm.vis.Tiling(cell(0, 0), varargin{:});
162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
165 %> Configure the figure settings and specifications,
166 %> make the figure and the subplots, and
return nothing.
167 %> The subplots are made by calling their ``make()`` methods.
170 %> This method has side-effects by manipulating
171 %> the existing attributes of the parent
object.
173 %> \param[in] varargin : Any ``property, value`` pair of the parent
object.<br>
174 %> If the
property is a ``
struct()``, then its value must be given as a cell array,
175 %> with consecutive elements representing the
struct ``property-
name, property-value`` pairs.
176 %> Note that all of these property-value pairs can be also directly set via the
177 %> parent
object attributes, before calling the ``make()`` method.
182 %> f = pm.vis.Corner.make(varargin);
188 %> f = pm.vis.Corner();
194 %> \JoshuaOsborne, May 21 2024, 7:56 AM, University of Texas at Arlington<br>
195 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
196 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
197 function make(self, varargin)
199 self.premake(varargin{:});
201 %%%% First set the tile dimensions.
203 if isempty(self.cols)
204 warning ( "The ``cols`` component of the parent corner
object is empty." + newline ...
205 + "There is nothing to visualize." + newline ...
209 rank = length(self.cols);
212 %%%% Define the subplot cell matrix.
213 %%%% The following code block may be improved in
214 %%%% the future to avoid full data
copy to subplots.
217 self.subplot = cell(rank, rank);
222 copyStream = getByteStreamFromArray(self.diag);
224 copyStream = getByteStreamFromArray(self.lower);
226 copyStream = getByteStreamFromArray(self.upper);
228 self.subplot{irow, icol} = getArrayFromByteStream(copyStream);
229 isEllipsoid = isa(self.subplot{irow, icol},
"pm.vis.SubplotEllipse") || isa(self.subplot{irow, icol},
"pm.vis.SubplotEllipse3");
232 self.subplot{irow, icol}.dimx = self.cols(irow);
233 self.subplot{irow, icol}.dimy = self.cols(icol);
235 if isprop(self.subplot{irow, icol},
"colx")
236 self.subplot{irow, icol}.colx = self.cols(icol);
238 if isprop(self.subplot{irow, icol},
"coly")
239 self.subplot{irow, icol}.coly = self.cols(irow);
243 self.subplot{irow, icol}.colc = self.template.colc(iplt);
244 elseif lencolc == 1 && isprop(self.template,
"colorbar") && isempty(self.template.colorbar.enabled)
245 self.subplot{irow, icol}.colorbar.enabled =
false;
246 elseif lencolc == 0 && isprop(self.template,
"colormap") && isempty(self.template.colormap.enabled)
247 self.subplot{irow, icol}.colormap.enabled =
true;
253 make@pm.vis.Tiling(self);
255 %%%% Define a single colorbar.
259 unicbar = lencolc == 1;
260 if unicbar && ~isempty(self.template.colormap.enabled)
261 unicbar = self.template.colormap.enabled;
263 if unicbar && ~isempty(self.template.colorbar.enabled)
264 unicbar = self.template.colorbar.enabled;
268 %%%% Get the start and end positions of the leftmost, lowest, rightmost, and highest axes.
271 % positions = zeros(4, nplt);
272 % for icol = 1 : ncol
273 % for irow = 1 : nrow
274 % if pm.introspection.
istype(self.subplot{irow, icol},
"pm.vis.Subplot")
276 % positions(:, iplt) = self.subplot{irow, icol}.fout.axes.Position;
282 % start(i) = min(positions(i, :));
283 % finit(i) = max(positions(i, :) + positions(i + 2, :));
286 %%%% Create
new invisible axes.
289 for prop = [
"colorbar" ...
291 if isprop(self.template, prop)
292 kws.(prop) = self.template.comp2hash(prop);
295 %ax = axes(
"position", [start, finit],
"visible",
"off");
296 self.fout.colorbar = colorbar(kws.colorbar{:});
297 self.fout.colorbar.Layout.Tile =
'east';
299 dfcopy = self.template.df.copy();
300 [~, colnamc] = pm.str.locname(dfcopy.Properties.VariableNames, self.template.colc);
301 ylabel(self.fout.colorbar, colnamc(1));
309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
312 %> Reset the properties of the figure to the original
default settings.
313 %> Use
this method when you change many attributes of the plot and
314 %> you want to
clean up and go back to the
default settings.
316 %> \param[in] varargin : Any ``property, value`` pair of the parent
object.<br>
317 %> If the
property is a ``
struct()``, then its value must be given as a cell array,
318 %> with consecutive elements representing the
struct ``property-
name, property-value`` pairs.
319 %> Note that all of these property-value pairs can be also directly set via the
320 %> parent
object attributes, before calling the ``make()`` method.
325 %> pm.vis.Corner.reset() % reset all
object properties to the
default settings.
332 %> \JoshuaOsborne, May 21 2024, 7:58 AM, University of Texas at Arlington<br>
333 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
334 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
335 function reset(self, varargin)
341 reset@pm.vis.Tiling(self, varargin{:});
343 if isempty(self.diag)
346 if isempty(self.lower)
349 if isempty(self.upper)
353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
354 %%%% RULE 0: Any non-MATLAB-default setting must be preferably set in the make() method to override user null values.
355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
357 %self.premake(varargin{:}); % This is the subclass method!
360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
363 %> Prepare the corner plot specs
for subsequent visualization by ``make()``.
366 %> This method causes side-effects by manipulating
367 %> the existing attributes of the
object.
369 %> \param[in] varargin : Any ``property, value`` pair of the parent
object.<br>
370 %> If the
property is a ``
struct()``, then its value must be given as a cell array,
371 %> with consecutive elements representing the
struct ``property-
name, property-value`` pairs.
372 %> Note that all of these property-value pairs can be also directly set via the
373 %> parent
object attributes, before calling the ``make()`` method.
377 %> For example, change the left/bottom margin of the main
378 %> axis of the figure to provide room
for lengthy variable names.
379 %> Then call the ``self.update()`` method to reflect the changes.
384 %> \JoshuaOsborne, May 21 2024, 8:00 AM, University of Texas at Arlington<br>
385 function premake(self, varargin)
387 premake@pm.vis.Tiling(self, varargin{:});
388 %
if ~isa(self.diag,
"self.type.is.histfit") && ~isa(self.diag,
"self.type.is.histogram")
389 % help(
"pm.vis.Corner");
390 % error ( newline ...
391 % +
"The component ``diag`` of the parent object must be of" + newline ...
392 % +
"superclass [pm.vis.SubplotHistfit](@ref SubplotHistfit) or [pm.vis.SubplotHistogram](@ref SubplotHistogram)." + newline ...
393 % +
"For more information, see the class documentation displayed above." + newline ...
398 %
if self.lower.type.is.d1
399 % help(
"pm.vis.Corner");
400 % error ( newline ...
401 % +
"The component ``lower`` of the parent object must be of superclass" + newline ...
402 % +
" 1. pm.vis.SubplotLine" + newline ...
403 % +
" 2. pm.vis.SubplotScatter" + newline ...
404 % +
" 3. pm.vis.SubplotLineScatter" + newline ...
405 % +
" 4. pm.vis.SubplotLineScatter" + newline ...
406 % +
"For more information, see the class documentation displayed above." + newline ...
413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
419 methods(Access =
public, Hidden)
421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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 base class for generating instances of figures containing a symmetric square grid or corn...
function premake(in self, in varargin)
Prepare the corner plot specs for subsequent visualization by make().
function reset(in self, in varargin)
Reset the properties of the figure to the original default settings. Use this method when you change ...
function make(in self, in varargin)
Configure the figure settings and specifications, make the figure and the subplots,...
function Corner(in df, in varargin)
Generate an return an object of class pm.vis.Corner.
This is the abstract class for generating instances of objects that can contain basic attributes requ...
This is the SubplotContour class for generating instances of 2-dimensional Contour Subplot visualizat...
This is the SubplotHistogram class for generating instances of 1-dimensional Histogram Subplot visual...
This is the SubplotLineScatter class for generating instances of 2-dimensional Line-Scatter Subplot v...
This is the abstract class for generating instances of axes with various types of plots from one or m...
This is the base class for generating instances of figures containing a tile of subplots.
function clean()
Remove all paths that contain the ParaMonte lib directory from the MATLAB path variable.
function copy(in from, in to, in fields)
Copy the contents of the struct/object from to the struct/object to recursively and without destroyin...
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...