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.Figure](@ref Figure)<br>
15%> [pm.vis.Corner](@ref Corner)<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] lb : The input MATLAB object that can be either:<br>
96 %> <ol>
97 %> <li> a scalar of type double representing the lower bound of the Heatmap colormap range.<br>
98 %> <li> a vector of type double of size ``2`` representing the lower
99 %> and upper bounds of the Heatmap colormap range.<br>
100 %> </ol>
101 %> (**optional**. If missing, the current value will remain intact.)
102 %>
103 %> \param[in] ub : The input MATLAB scalar double representing the upper bound of the Heatmap colormap limits.<br>
104 %> Its value is completely ignored if the input ``lb`` argument is a vector of size ``2``.<br>
105 %> (**optional**. If missing, the current value will remain intact.)
106 %>
107 %> \interface{setColorLim}
108 %> \code{.m}
109 %>
110 %> h = pm.vis.Subplot.make();
111 %> h = pm.vis.Subplot.make([]);
112 %> h = pm.vis.Subplot.make([], []);
113 %> h = pm.vis.Subplot.make(lb, []);
114 %> h = pm.vis.Subplot.make([], ub);
115 %> h = pm.vis.Subplot.make(lb, ub);
116 %>
117 %> \endcode
118 %>
119 %> \example{setColorLim}
120 %> \code{.m}
121 %>
122 %> h = pm.vis.SubplotHeatmap(dfref);
123 %> h.make()
124 %>
125 %> h.setColorLim() % symmetrize the current range.
126 %> h.setColorLim(1) % set the lower bound to 1.
127 %> h.setColorLim([], 1) % set the upper bound to 1.
128 %> h.setColorLim(1, 2) % set the lower and upper bounds to 1 and 2.
129 %> h.setColorLim([1, 2]) % set the lower and upper bounds to 1 and 2.
130 %>
131 %> \endcode
132 %>
133 %> \example{setColorLim}
134 %> \include{lineno} example/vis/SubplotHeatmap/main.m
135 %> \vis{setColorLim}
136 %> <br>\image html example/vis/SubplotHeatmap/SubplotHeatmap.1.png width=700
137 %>
138 %> \final{setColorLim}
139 %>
140 %> \author
141 %> \JoshuaOsborne, May 21 2024, 5:54 PM, University of Texas at Arlington<br>
142 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
143 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
144 function setColorLim(self, lb, ub)
145
146 if isfield(self.fout, "heatmap") && isprop(self.fout.heatmap, "ColorLimits")
147 if nargin < 3
148 ub = [];
149 end
150 if nargin < 2
151 lb = [];
152 elseif 1 < length(lb)
153 ub = lb(2);
154 lb = lb(1);
155 end
156 if isempty(lb) && isempty(ub)
157 % symmetrize the existing range.
158 maxval = max(abs(self.fout.heatmap.ColorLimits));
159 limits = [-maxval, maxval];
160 else
161 limits = self.fout.heatmap.ColorLimits;
162 if ~isempty(lb)
163 limits(1) = lb;
164 end
165 if ~isempty(ub)
166 limits(2) = ub;
167 end
168 end
169 self.fout.heatmap.ColorLimits = limits;
170 else
171 error ( newline ...
172 + "There is no component ``fout.heatmap.ColorLimits`` for this object to adjust the limits." + newline ...
173 + newline ...
174 );
175 end
176 end
177
178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179
180 end
181
182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
183
184end % classdef
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared libraries.
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 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 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:9