ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
SubplotHeatmap.m
Go to the documentation of this file.
1%> \brief
2%> This is the SubplotHeatmap class for generating
3%> instances of 2-dimensional Heatmap [Subplot visualizations](@ref Subplot)
4%> based on the relevant MATLAB
5%> intrinsic functions.<br>
6%>
7%> \note
8%> See the documentation of the constructor of the class
9%> [pm.vis.SubplotHeatmap](@ref SubplotHeatmap::SubplotHeatmap) for example usage.<br>
10%>
11%> \see
12%> [pm.vis.Cascade](@ref Cascade)<br>
13%> [pm.vis.Subplot](@ref Subplot)<br>
14%> [pm.vis.Triplex](@ref Triplex)<br>
15%> [pm.vis.Figure](@ref Figure)<br>
16%> [pm.vis.Plot](@ref Plot)<br>
17%> [pm.vis.Tile](@ref Tile)<br>
18%>
19%> \final
20%>
21%> \author
22%> \JoshuaOsborne, May 21 2024, 6:05 PM, University of Texas at Arlington<br>
23%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
24%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
25classdef SubplotHeatmap < pm.vis.Subplot
26
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28
29 methods(Access = public)
30
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32
33 %> \brief
34 %> Construct and return an object of class [pm.vis.SubplotHeatmap](@ref SubplotHeatmap).<br>
35 %>
36 %> \details
37 %> This is the constructor of the class [pm.vis.SubplotHeatmap](@ref SubplotHeatmap).<br>
38 %>
39 %> \param[in] dfref : See the documentation of the corresponding input
40 %> argument of the superclass [pm.vis.Subplot](@ref Subplot).<br>
41 %> \param[in] varargin : Any ``property, value`` pair of the parent object.<br>
42 %> If the property is a ``struct()``, then its value must be given as a cell array,
43 %> with consecutive elements representing the struct ``property-name, property-value`` pairs.<br>
44 %> Note that all of these property-value pairs can be also directly set via the
45 %> parent object attributes, before calling the ``make()`` method.<br>
46 %>
47 %> \return
48 %> ``self`` : The output object of class [pm.vis.SubplotHeatmap](@ref SubplotHeatmap).<br>
49 %>
50 %> \interface{SubplotHeatmap}
51 %> \code{.m}
52 %>
53 %> s = pm.vis.SubplotHeatmap(dfref);
54 %> s = pm.vis.SubplotHeatmap(dfref, varargin);
55 %>
56 %> \endcode
57 %>
58 %> \note
59 %> See also the documentation of the attributes
60 %> of the superclass [pm.vis.Subplot](@ref Subplot).<br>
61 %>
62 %> \example{SubplotHeatmap}
63 %> \include{lineno} example/vis/SubplotHeatmap/main.m
64 %> \vis{Subplot}
65 %> <br>\image html example/vis/SubplotHeatmap/SubplotHeatmap.1.png width=700
66 %>
67 %> \final{SubplotHeatmap}
68 %>
69 %> \author
70 %> \JoshuaOsborne, May 21 2024, 6:05 PM, University of Texas at Arlington<br>
71 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
72 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
73 function self = SubplotHeatmap(dfref, varargin)
74 if nargin < 1
75 dfref = [];
76 end
77 self = self@pm.vis.Subplot("Heatmap", dfref, varargin{:});
78 end
79
80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81
82 %> \brief
83 %> Reset the heatmap colormap limits to the user-specified limits ``lb`` and ``ub``.<br>
84 %> If either is empty or missing, keep the existing limit for the corresponding empty limit.<br>
85 %> If both are empty or missing, symmetrize the existing limits.<br>
86 %> The specified input values will be used to set the ``ColorLimits``
87 %> component of the Heatmap object as ``ColorLimits = [lb, ub]``.<br>
88 %> If both input values are missing, the current colormap
89 %> range of the Heatmap subplots will be symmetrized.<br>
90 %>
91 %> \warning
92 %> This method has side-effects by manipulating
93 %> the existing attributes of the parent object.<br>
94 %>
95 %> \param[in] self : The **implicitly-passed** input argument representing the parent object of the method.<br>
96 %> \param[in] lb : The input MATLAB object that can be either:<br>
97 %> <ol>
98 %> <li> a scalar of type double representing the lower bound of the Heatmap colormap range.<br>
99 %> <li> a vector of type double of size ``2`` representing the lower
100 %> and upper bounds of the Heatmap colormap range.<br>
101 %> </ol>
102 %> (**optional**. If missing, the current value will remain intact.)
103 %>
104 %> \param[in] ub : The input MATLAB scalar double representing the upper bound of the Heatmap colormap limits.<br>
105 %> Its value is completely ignored if the input ``lb`` argument is a vector of size ``2``.<br>
106 %> (**optional**. If missing, the current value will remain intact.)
107 %>
108 %> \interface{setColorLim}
109 %> \code{.m}
110 %>
111 %> h = pm.vis.Subplot.make();
112 %> h = pm.vis.Subplot.make([]);
113 %> h = pm.vis.Subplot.make([], []);
114 %> h = pm.vis.Subplot.make(lb, []);
115 %> h = pm.vis.Subplot.make([], ub);
116 %> h = pm.vis.Subplot.make(lb, ub);
117 %>
118 %> \endcode
119 %>
120 %> \example{setColorLim}
121 %> \code{.m}
122 %>
123 %> h = pm.vis.SubplotHeatmap(dfref);
124 %> h.make()
125 %>
126 %> h.setColorLim() % symmetrize the current range.
127 %> h.setColorLim(1) % set the lower bound to 1.
128 %> h.setColorLim([], 1) % set the upper bound to 1.
129 %> h.setColorLim(1, 2) % set the lower and upper bounds to 1 and 2.
130 %> h.setColorLim([1, 2]) % set the lower and upper bounds to 1 and 2.
131 %>
132 %> \endcode
133 %>
134 %> \example{setColorLim}
135 %> \include{lineno} example/vis/SubplotHeatmap/main.m
136 %> \vis{setColorLim}
137 %> <br>\image html example/vis/SubplotHeatmap/SubplotHeatmap.1.png width=700
138 %>
139 %> \final{setColorLim}
140 %>
141 %> \author
142 %> \JoshuaOsborne, May 21 2024, 5:54 PM, University of Texas at Arlington<br>
143 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
144 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
145 function setColorLim(self, lb, ub)
146
147 if isfield(self.fout, "heatmap") && isprop(self.fout.heatmap, "ColorLimits")
148 if nargin < 3
149 ub = [];
150 end
151 if nargin < 2
152 lb = [];
153 elseif 1 < length(lb)
154 ub = lb(2);
155 lb = lb(1);
156 end
157 if isempty(lb) && isempty(ub)
158 % symmetrize the existing range.
159 maxval = max(abs(self.fout.heatmap.ColorLimits));
160 limits = [-maxval, maxval];
161 else
162 limits = self.fout.heatmap.ColorLimits;
163 if ~isempty(lb)
164 limits(1) = lb;
165 end
166 if ~isempty(ub)
167 limits(2) = ub;
168 end
169 end
170 self.fout.heatmap.ColorLimits = limits;
171 else
172 error ( newline ...
173 + "There is no component ``fout.heatmap.ColorLimits`` for this object to adjust the limits." + newline ...
174 + newline ...
175 );
176 end
177 end
178
179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180
181 end
182
183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
184
185end % classdef
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared library directories.
function abs(in path, in style)
Return the Get absolute canonical path of a file or folder.
This is the abstract class for generating instances of objects that contain the specifications of a c...
Definition: Cascade.m:32
This is the abstract class for generating instances of objects that contain the specifications of var...
Definition: Figure.m:27
This is the base class for generating instances of objects that contain the specifications of various...
Definition: Plot.m:29
This is the SubplotHeatmap class for generating instances of 2-dimensional Heatmap Subplot visualizat...
function SubplotHeatmap(in dfref, in varargin)
Construct and return an object of class pm.vis.SubplotHeatmap.
function setColorLim(in self, in lb, in ub)
Reset the heatmap colormap limits to the user-specified limits lb and ub. If either is empty or miss...
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:23
This is the base class for generating instances of figures containing a square symmetric tiling of su...
Definition: Triplex.m:31