3%> instances of 3-dimensional Ellipse [
Subplot visualizations](@ref
Subplot)
4%> based on the relevant MATLAB intrinsic functions.<br>
7%> See the documentation of the constructor of the
class
11%> See the
list of
class attributes below,
15%> [pm.vis.Cascade](@ref
Cascade)<br>
16%> [pm.vis.Subplot](@ref
Subplot)<br>
17%> [pm.vis.Triplex](@ref
Triplex)<br>
18%> [pm.vis.Figure](@ref
Figure)<br>
19%> [pm.vis.Plot](@ref
Plot)<br>
20%> [pm.vis.Tile](@ref
Tile)<br>
25%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
26%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
28 properties(Access =
public)
32 %> The vector of MATLAB strings containing the names of dimensions
33 %> of the space within
which the Gramian matrices are defined.<br>
34 %> The
default is ``
"Dimension i"`` where ``i`` is replaced
35 %> by the ID of the corresponding axis.<br>
41 %> The MATLAB scalar (or vector) of whole-number(s) representing the dimension(s) of the
42 %> input ``gramian`` and ``center`` data to be used on the x-axis of 2D ellipsoid visualization.<br>
43 %> The
default is ``1``
if ``dimy`` component is also unspecified, or the appropriate data column adjacent to ``dimmy``.<br>
44 %> If the condition ``dimx == dimy`` holds, then the resulting ellipses will be circles.<br>
50 %> The MATLAB scalar (or vector) of whole-number(s) representing the dimension(s) of the
51 %> input ``gramian`` and ``center`` data to be used on the y-axis of 2D ellipsoid visualization.<br>
52 %> The
default is ``1``
if ``dimx`` component is also unspecified, or the appropriate data column adjacent to ``dimmx``.<br>
53 %> If the condition ``dimx == dimy`` holds, then the resulting ellipses will be circles.<br>
59 %> The vector of MATLAB whole numbers representing the ellindex of the 2D
60 %> ellipsoids to display, represented by the input ``gramian`` and ``center``.<br>
61 %> The specified ellindex will serve as the visualization values on the z-axis.<br>
62 %> The
default is ``ellindex = pm.array.logrange(start = 1, stop = nell, count = 75);``,
63 %> where ``nell`` represents the number of ellipsoids to visualize.<br>
69 %> A scalar
object of
class [pm.container.DataRef](@ref
DataRef)
70 %> containing the user-specified Gramian data to visualize.<br>
76 %> A scalar
object of
class [pm.container.DataRef](@ref
DataRef)
77 %> containing the user-specified center data to visualize.<br>
83 %> A scalar
object of
class [pm.container.DataRef](@ref
DataRef)
84 %> containing the user-specified z-axis data to visualize.<br>
90 %> A scalar
object of
class [pm.container.DataRef](@ref
DataRef)
91 %> containing the user-specified color data in colormap.<br>
92 %> If empty or unspecified, it will be set to ``zval`` component.<br>
97 properties(Access =
public, Hidden)
101 %> A scalar MATLAB whole number representing the total number of the
102 %> dimensions of ellipsoids identified based on the input that can be visualized.<br>
103 %> It is set to ``max(2, size(gramian, 2), size(center, 1))``.<br>
109 %> A scalar MATLAB whole number representing the total number of
110 %> ellipsoids identified based on the input that can be visualized.<br>
111 %> It is set to ``max(20, size(gramian, 3), size(center, 2), size(zval, 2))``.<br>
117 %> The scalar MATLAB whole number representing the number of
118 %> points with
which the 2D ellipsoid boundaries are delineated.<br>
119 %> It is set to ``max(size(zval, 1), size(cval, 1))`` or otherwise, ``100``.<br>
125 %> A scalar MATLAB ``
struct()`` containing the current visualization information.<br>
126 %> This information is updated with every call to the ``make()`` method.<br>
127 %> The contents of
this component are temporary and must remain read-only.<br>
128 %> This component is solely provided
for better insight into the internal
129 %> workings of the ``make()`` method of the parent
object and
130 %> the resulting visualization.<br>
135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137 methods(Access =
public)
140 %> Construct and
return an
object of
class [pm.vis.SubplotEllipse](@ref
SubplotEllipse).<br>
143 %> In the following documentation,
145 %> <li> The variable ``ndim`` represents the number of ellipsoids in the input data.<br>
146 %> The value of ``ndim`` is inferred from the shapes of the input ``gramian``
147 %> and ``center`` arguments as ``max([2, size(gramian, 1), size(center, 1)])``.<br>
149 %> <li> The variable ``nell`` represents the number of ellipsoids in the input data.<br>
150 %> The value of ``nell`` is inferred from the shapes
151 %> of the input ``gramian``, ``center``, ``zval``, and ``cval`` arguments
152 %> as ``max([size(gramian, 3), size(center, 2), size(zval, 2), size(cval, 2)])``.<br>
153 %> If the above expression yields zero, then ``nell`` is set to ``75``.<br>
155 %> <li> The variable ``npnt`` represents the number of points used in visualizing each ellipsoid.<br>
156 %> The value of ``npnt`` is inferred from the shapes of the input arguments
157 %> ``zval`` and ``czval`` as ``max(size(zval, 1), size(cval, 1))``.<br>
158 %> If the above expression yields zero or one, then ``npnt`` is set to ``100``.<br>
161 %> \param[in] gramian : The MATLAB (function handle returning an)
object that can be either,<br>
163 %> <li> an empty object (e.g., ``[]``), in
which case,
164 %> the value ``repmat(eye(ndim, ndim), 1, 1, nell)`` will be used.<br>
166 %> <li> a scalar, containing the value of the diagonal elements
167 %> of the diagonal matrices representing the Gramian matrices
168 %> of all ``nell`` ellipsoids in the input data.<br>
170 %> <li> a vector of shape ``[1, 1, nell]`` such that ``gramian(1, 1, iell)``
171 %> represents the diagonal value to be used in constructing the Gramian
172 %> matrix of the ellipsoid ``iell` in the input ``nell`` ellipsoid data.<br>
174 %> <li> a matrix of shape ``[ndim, ndim, 1]`` used in constructing the Gramian
175 %> matrices of all ``nell`` ellipsoids in the input data.<br>
177 %> <li> a tensor of shape ``[ndim, ndim, nell]`` such that ``gramian(:, :, iell)``
178 %> represents the Gramian matrix of the ellipsoid ``iell` in the input data.<br>
180 %> While it is possible to pass a data directly to
this class,
181 %> it is highly recommended to pass a function handle that returns
182 %> such data when called, allowing the visualization data to be
183 %> dynamically updated when needed.<br>
184 %> \param[in] center : The MATLAB (function handle returning an)
object that can be either,<br>
186 %> <li> an empty object (e.g., ``[]``), in
which case,
187 %> the value ``zeros(ndim, nell)`` will be used.<br>
189 %> <li> a scalar, containing the value to assign to all coordinates
190 %> of the centers of all ``nell`` ellipsoids in the input data.<br>
192 %> <li> a vector of shape ``[1, nell]`` such that ``center(1, iell)``
193 %> represents the value of all coordinates of the center of the
194 %> ellipsoid ``iell` in the input ``nell`` ellipsoid data.<br>
196 %> <li> a vector of shape ``[ndim, 1]`` such that ``center(idim, 1)``
197 %> represents the value of ``idim`` coordinate of the centers of
198 %> all ``nell`` ellipsoids in the input data.<br>
200 %> <li> a matrix of shape ``[ndim, nell]`` such that ``center(:, iell)`` represents
201 %> the coordinates of the center of the ellipsoid ``iell` in the input data.<br>
203 %> While it is possible to pass data directly to
this class,
204 %> it is highly recommended to pass a function handle that returns
205 %> such data when called, allowing the visualization data to be
206 %> dynamically updated when needed.<br>
207 %> \param[in] zval : The MATLAB (function handle returning an)
object that can be either,<br>
209 %> <li> an empty object (e.g., ``[]``), in
which case,
210 %> the value ``repmat(1 : nell, npnt, 1)`` will be used.<br>
212 %> <li> a scalar, containing the value to assign to the z-axis
213 %> coordinates of all ``npnt`` points used in the visualization
214 %> of ``nell`` ellipsoids in the input data.<br>
216 %> <li> a vector of shape ``[1, nell]`` such that ``zval(1, iell)``
217 %> represents the value of z-axis coordinates of all ``npnt``
218 %> points used in the visualization of the ellipsoid
219 %> ``iell` in the input ``nell`` ellipsoid data.<br>
221 %> <li> a vector of shape ``[npnt, 1]`` such that ``zval(ipnt, 1)``
222 %> contains the z-axis value of ``ipnt`` points in the representations
223 %> of all ``nell`` ellipsoids in the input data.<br>
225 %> <li> a matrix of shape ``[npnt, nell]`` such that ``zval(:, iell)`` represents
226 %> the z-axis coordinates of all ``npnt`` points used in the visualization of
227 %> the ellipsoid ``iell` in the input data.<br>
229 %> While it is possible to pass data directly to
this class,
230 %> it is highly recommended to pass a function handle that returns
231 %> such data when called, allowing the visualization data to be
232 %> dynamically updated when needed.<br>
233 %> \param[in] cval : The MATLAB (function handle returning an)
object that can be either,<br>
235 %> <li> an empty object (e.g., ``[]``), in
which case,
236 %> the input value ``zval`` will be used.<br>
238 %> <li> a scalar, containing the value to assign to color values
239 %> of all ``npnt`` points used in the visualization
240 %> of ``nell`` ellipsoids in the input data.<br>
242 %> <li> a vector of shape ``[1, nell]`` such that ``cval(1, iell)``
243 %> represents the color values of all ``npnt`` points used in the
244 %> visualization of the ellipsoid ``iell` in the input ``nell`` ellipsoid data.<br>
246 %> <li> a vector of shape ``[npnt, 1]`` such that ``cval(ipnt, 1)``
247 %> contains the color values of ``ipnt`` points in the representations
248 %> of all ``nell`` ellipsoids in the input data.<br>
250 %> <li> a matrix of shape ``[npnt, nell]`` such that ``center(:, iell)`` represents
251 %> the color values of all ``npnt`` points used in the visualization of
252 %> the ellipsoid ``iell` in the input data.<br>
254 %> While it is possible to pass data directly to
this class,
255 %> it is highly recommended to pass a function handle that returns
256 %> such data when called, allowing the visualization data to be
257 %> dynamically updated when needed.<br>
258 %> The input value
for ``cval`` is used only
if ``colormap.enabled`` component of the
259 %> output
object of
class [pm.vis.SubplotEllipse3](@ref
SubplotEllipse3) is set to ``true``.<br>
260 %> \param[in] varargin : Any ``property, value`` pair of the
object.<br>
261 %> If the
property is a ``
struct()``, then its value must be given as a cell array,
262 %> with consecutive elements representing the
struct ``property-
name, property-value`` pairs.<br>
263 %> Note that all of these property-value pairs can be also directly set via the
264 %> parent
object attributes, before calling the ``make()`` method.<br>
267 %> ``self`` : The output
object of
class [pm.vis.SubplotEllipse3](@ref
SubplotEllipse3).<br>
272 %> s = pm.vis.SubplotEllipse3(gramian);
273 %> s = pm.vis.SubplotEllipse3(gramian, center);
274 %> s = pm.vis.SubplotEllipse3(gramian, center, zval);
275 %> s = pm.vis.SubplotEllipse3(gramian, center, zval, cval);
276 %> s = pm.vis.SubplotEllipse3(gramian, center, zval, cval, varargin);
281 %> To generate a 2D plot of ellipsoids, simply execute the
282 %> MATLAB command ``view(2)`` to change the camera view to 2D.<br>
285 %> See also the documentation of the attributes
296 %> \JoshuaOsborne, May 21 2024, 5:35 PM, University of Texas at Arlington<br>
297 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
298 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
301 %%%% Define the missing optional values as empty with the right rank.
310 center = zeros(0, 0);
313 gramian = zeros(0, 0, 0);
316 varargin = {
"gramian", pm.container.DataRef(gramian) ...
317 ,
"center", pm.container.DataRef(center) ...
318 ,
"zval", pm.container.DataRef(zval) ...
319 ,
"cval", pm.container.DataRef(cval) ...
322 self = self@pm.vis.SubplotLineScatter3([], varargin{:})
327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
329 methods(Access =
public)
332 %> Reset the properties of the plot to the original
default settings.<br>
335 %> Use
this method when you change many attributes of the plot and
336 %> you want to
clean up and go back to the
default settings.<br>
338 %> \param[inout] self : The **implicitly-passed** input argument representing the parent
object of the method.<br>
339 %> \param[in] varargin : Any ``property, value`` pair of the parent
object.<br>
340 %> If the
property is a ``
struct()``, then its value must be given as a cell array,
341 %> with consecutive elements representing the
struct ``property-
name, property-value`` pairs.<br>
342 %> Note that all of these property-value pairs can be also directly set via the
343 %> parent
object attributes, before calling the ``make()`` method.<br>
348 %> pm.vis.SubplotEllipse3.reset() % reset the plot to the
default settings.
349 %> pm.vis.SubplotEllipse3.reset(varargin)
356 %> \JoshuaOsborne, May 22 2024, 5:42 PM, University of Texas at Arlington<br>
357 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
358 function reset(self, varargin)
364 reset@pm.vis.SubplotLineScatter3(self, varargin{:});
365 self.surface.lineWidth = [];
366 self.scatter3.enabled = [];
367 self.surface.enabled = [];
368 self.plot3.enabled = [];
369 self.colormap.map = []; %
"winter"
370 self.colormap.enabled = [];
375 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
377 methods(Access =
public, Hidden)
380 %> Prepare the subplot
for visualization.<br>
383 %> This method has side-effects by manipulating
384 %> the existing attributes of the parent
object.<br>
386 %> \param[inout] self : The input/output parent
object of
class [pm.vis.SubplotEllipse3](@ref
SubplotEllipse3)
387 %>
which is **implicitly** passed to
this dynamic method (not by the user).<br>
388 %> \param[in] varargin : Any ``property, value`` pair of the parent
object.<br>
389 %> If the
property is a ``
struct()``, then its value must be given as a cell array,
390 %> with consecutive elements representing the
struct ``property-
name, property-value`` pairs.<br>
391 %> Note that all of these property-value pairs can be also directly set via the
392 %> parent
object attributes, before calling the ``premake()`` method.<br>
394 %> \interface{premake}
397 %> pm.vis.SubplotEllipse3.premake();
398 %> pm.vis.SubplotEllipse3.premake(varargin);
405 %> s = pm.vis.SubplotEllipse3();
406 %> s.premake(
"dimx", 1,
"dimy", 2],
"colormap", {
"map",
"autumn"})
413 %> \JoshuaOsborne, May 22 2024, 5:45 PM, University of Texas at Arlington<br>
414 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
415 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
416 function premake(self, varargin)
418 if ~isempty(varargin)
419 self.hash2comp(varargin); % parse arguments
423 %%%% Set the visualization types.
426 if isempty(self.colormap.map)
427 self.colormap.
map = "winter";
430 if isempty(self.colormap.enabled)
431 self.colormap.enabled = true;
434 if isempty(self.colorbar.enabled)
435 self.colorbar.enabled = self.colormap.enabled;
438 if isempty(self.plot3.enabled)
439 self.plot3.enabled = ~self.colormap.enabled;
442 if isempty(self.surface.enabled)
443 self.surface.enabled = self.colormap.enabled;
446 if isempty(self.scatter3.enabled)
447 self.scatter3.enabled = ~(self.plot3.enabled || self.surface.enabled);
451 %%%% Set the visualization specs.
454 if isempty(self.surface.lineWidth)
455 self.surface.lineWidth = 1.5;
459 %%%% Set the visualization specs of the parent (and set the data components).
465 %%%% Set the line color to default MATLAB blue only if scatter is disabled and colormap is disabled and color is unset by the user.
468 if ~(self.colormap.enabled || self.scatter3.enabled)
469 [val, failed] = pm.matlab.hashmap.
getKeyVal("plot3", varargin);
471 [~, failed] = pm.matlab.hashmap.
getKeyVal("color", val);
474 self.plot3.color = [0, 0.4470, 0.7410];
482 self.workspace = struct();
483 self.workspace.cval = self.cval.
copy();
484 self.workspace.zval = self.zval.
copy();
485 self.workspace.center = self.center.
copy();
486 self.workspace.gramian = self.gramian.
copy();
489 %%%% Get the shape of input data.
492 %%%% The following ``size()`` syntax is essential for compatibility with MATLAB R2019a.
494 self.workspace.shape = struct();
496 [s1, s2] = size(self.workspace.cval);
497 self.workspace.shape.cval = [s1, s2];
499 [s1, s2] = size(self.workspace.zval);
500 self.workspace.shape.zval = [s1, s2];
502 [s1, s2] = size(self.workspace.center);
503 self.workspace.shape.center = [s1, s2];
505 [s1, s2, s3] = size(self.workspace.gramian);
506 self.workspace.shape.gramian = [s1, s2, s3];
512 self.ndim = max([2, self.workspace.shape.gramian(1), self.workspace.shape.center(1)]);
521 self.nell = max([self.workspace.shape.gramian(3), self.workspace.shape.center(2), self.workspace.shape.zval(2), self.workspace.shape.cval(2)]);
530 if isempty(self.npnt)
531 self.npnt = max(self.workspace.shape.zval(1), self.workspace.shape.cval(1));
538 %%%% Assert data shape consistencies.
542 asserted = asserted && self.ndim == self.workspace.shape.center(1) || self.workspace.shape.center(1) < 2;
543 asserted = asserted && self.ndim == self.workspace.shape.gramian(1) || self.workspace.shape.gramian(1) < 2;
544 asserted = asserted && self.ndim == self.workspace.shape.gramian(2) || self.workspace.shape.gramian(2) < 2;
545 asserted = asserted && self.nell == self.workspace.shape.gramian(3) || self.workspace.shape.gramian(3) < 2;
546 asserted = asserted && self.nell == self.workspace.shape.center(2) || self.workspace.shape.center(2) < 2;
547 asserted = asserted && self.nell == self.workspace.shape.zval(2) || self.workspace.shape.zval(2) < 2;
548 asserted = asserted && self.nell == self.workspace.shape.cval(2) || self.workspace.shape.cval(2) < 2;
552 disp("size(gramian)")
553 disp( self.workspace.shape.gramian )
555 disp( self.workspace.shape.center )
557 disp( self.workspace.shape.zval )
559 disp( self.workspace.shape.cval )
561 disp( [self.ndim, self.nell] )
563 + "The shapes of the specified ``gramian``, ``center``, ``zval``, and ``cval`` are incompatible." + newline ...
564 + "For more information, see the documentation of the input arguments to the
object constructor displayed above." + newline ...
570 %%%% Set the default dimx and dimy or
verify the custom values to visualize.
573 if isempty(self.dimx) && isempty(self.dimy)
574 self.workspace.dimx = 1;
575 self.workspace.dimy = 2;
576 elseif isempty(self.dimx) && ~isempty(self.dimy)
577 self.workspace.dimy = self.dimy;
578 self.workspace.dimx = zeros(numel(self.dimy), 1);
579 for i = 1 : numel(self.dimy)
581 self.workspace.dimx(i) = self.dimy(i) + 1;
583 self.workspace.dimx(i) = self.dimy(i) - 1;
586 elseif isempty(self.dimy) && ~isempty(self.dimx)
587 self.workspace.dimx = self.dimx;
588 self.workspace.dimy = zeros(numel(self.dimx), 1);
589 for i = 1 : numel(self.dimx)
591 self.workspace.dimy(i) = self.dimx(i) + 1;
593 self.workspace.dimy(i) = self.dimx(i) - 1;
597 self.workspace.dimx = self.dimx;
598 self.workspace.dimy = self.dimy;
601 if numel(self.workspace.dimx) ~= numel(self.workspace.dimy)
602 if numel(self.workspace.dimx) == 1
603 self.workspace.dimx = self.workspace.dimx * ones(numel(self.workspace.dimy), 1);
604 elseif numel(self.workspace.dimy) == 1
605 self.workspace.dimy = self.workspace.dimy * ones(numel(self.workspace.dimx), 1);
610 disp("size(self.dimx)")
611 disp( size(self.dimx) )
614 disp("size(self.dimy)")
615 disp( size(self.dimy) )
617 + "The sizes of the specified ``dimx`` and ``dimy`` must either be equal or one must have size of ``1``." + newline ...
618 + "For more information, see the documentation displayed above." + newline ...
625 %%%% Check the consistency of shape of ``self.names``.
628 if ~isempty(self.names) && pm.array.
len(self.names) ~= self.ndim
630 disp("
string(self.names)")
631 disp(
string(self.names) )
632 disp("length(
string(self.names))")
633 disp( length(
string(self.names)) )
635 + "The component ``names`` must be a vector of size ``ndim`` of strings." + newline ...
636 + "For more information, see the documentation displayed above." + newline ...
642 %%%% Set the visualization axes names.
645 if ~isempty(self.names)
646 self.workspace.names =
string(self.names);
647 self.workspace.names = self.workspace.names(:);
649 self.workspace.names = strings(self.ndim, 1);
650 for idim = 1 : self.ndim
651 self.workspace.names(idim) = "Dimension " +
string(idim);
655 if ~pm.array.
len(self.xlabel.txt)
656 self.xlabel.txt =
string(self.workspace.names(self.workspace.dimx(:)));
658 if ~pm.array.
len(self.ylabel.txt)
659 self.ylabel.txt =
string(self.workspace.names(self.workspace.dimy(:)));
661 if ~pm.array.
len(self.zlabel.txt)
662 if ~isempty(self.workspace.zval)
663 self.zlabel.txt = "Z";
665 self.zlabel.txt = "Ellipsoid Index";
670 %%%% Setup the gramian values.
673 if numel(self.workspace.gramian) == 0
674 % The gramians of all ellipsoids are equal and identity matrix.
675 self.workspace.gramian = repmat(eye(self.ndim, self.ndim), 1, 1, self.nell);
676 elseif numel(self.workspace.gramian) == 1
677 % The gramians of all ellipsoids are equal and a multiple of the identity matrix.
678 self.workspace.gramian = repmat(self.workspace.gramian * eye(self.ndim, self.ndim), 1, 1, self.nell);
679 elseif size(self.workspace.gramian, 1) == self.ndim && size(self.workspace.gramian, 2) == self.ndim && size(self.workspace.gramian, 3) == 1
680 % All ellipsoids have the same user-prescribed self.workspace.gramian matrix.
681 self.workspace.gramian = repmat(self.workspace.gramian(:, :, 1), 1, 1, self.nell);
682 elseif size(self.workspace.gramian, 1) == 1 && size(self.workspace.gramian, 2) == 1 && size(self.workspace.gramian, 3) == self.nell
683 % Each ellipse has its unique diagonal self.workspace.gramian matrix whose diagonal values are all equal and prescribed by the user.
684 temp = zeros(self.ndim, self.ndim, self.nell);
685 for iell = 1 : self.nell
686 temp(:, :, iell) = self.workspace.gramian(1, 1, iell) * eye(self.ndim, self.ndim);
688 self.workspace.gramian = temp;
689 elseif size(self.workspace.gramian, 1) ~= self.ndim && size(self.workspace.gramian, 2) ~= self.ndim && size(self.workspace.gramian, 3) ~= self.nell
691 disp("size(gramian)")
692 disp( size(self.workspace.gramian) )
693 disp("[self.ndim, self.nell]")
694 disp( [self.ndim, self.nell] )
696 + "The shapes of the specified ``gramian`` is incompatible with the" + newline ...
697 + "inferred number of ellipsoid dimensions ``ndim`` and the number of ellipsoids ``nell``." + newline ...
698 + "For more information, see the documentation of the ``gramian`` component displayed above." + newline ...
704 %%%% Setup the center values.
707 if numel(self.workspace.center) == 0
708 % The centers of all ellipsoids have the same coordinates and all coordinate axes have zero values.
709 self.workspace.center = zeros(self.ndim, self.nell);
710 elseif numel(self.workspace.center) == 1
711 % The centers of all ellipsoids have the same coordinates and all coordinate axes have equal non-zero values.
712 self.workspace.center = self.workspace.center * ones(self.ndim, self.nell);
713 elseif size(self.workspace.center, 1) == self.ndim && size(self.workspace.center, 2) == 1
714 % The centers of all ellipsoids have the same coordinates.
715 self.workspace.center = repmat(self.workspace.center, 1, self.nell);
716 elseif size(self.workspace.center, 1) == 1 && size(self.workspace.center, 2) == self.nell
717 % All coordinates of each ellipse self.workspace.center are the same.
718 self.workspace.center = repmat(self.workspace.center, self.ndim, 1);
719 elseif size(self.workspace.center, 1) ~= self.ndim || size(self.workspace.center, 2) ~= self.nell
721 disp("size(self.workspace.center)")
722 disp( size(self.workspace.center) )
723 disp("[self.ndim, self.nell]")
724 disp( [self.ndim, self.nell] )
726 + "The shapes of the specified ``center`` is incompatible with the" + newline ...
727 + "inferred number of ellipsoid dimensions ``ndim`` and the number of ellipsoids ``nell``." + newline ...
728 + "For more information, see the documentation of the ``center`` component displayed above." + newline ...
734 %%%% Setup the zval values.
737 if numel(self.workspace.zval) == 0
738 % 2D plot in 3D visualization at zero z value.
739 self.workspace.zval = repmat(1 : self.nell, self.npnt, 1);
740 if isempty(self.zscale)
743 elseif numel(self.workspace.zval) == 1
744 % 2D plot in 3D visualization at a non-zero z value.
745 self.workspace.zval = self.workspace.zval * ones(self.npnt, self.nell);
746 elseif size(self.workspace.zval, 1) == self.npnt && size(self.workspace.zval, 2) == 1
747 % The corresponding points on all ellipsoids have the same z values.
748 self.workspace.zval = repmat(self.workspace.zval, 1, self.nell);
749 elseif size(self.workspace.zval, 1) == 1 && size(self.workspace.zval, 2) == self.nell
750 % All points on each ellipse have the same z values.
751 self.workspace.zval = repmat(self.workspace.zval, self.npnt, 1);
752 elseif size(self.workspace.zval, 1) ~= self.npnt || size(self.workspace.zval, 2) ~= self.nell
754 disp("size(self.workspace.zval)")
755 disp( size(self.workspace.zval) )
756 disp("[self.ndim, self.nell]")
757 disp( [self.ndim, self.nell] )
759 + "The shapes of the specified ``zval`` is incompatible with" + newline ...
760 + "the inferred number of ellipsoids ``nell`` in the input self.workspace." + newline ...
761 + "For more information, see the documentation of the ``zval`` component displayed above." + newline ...
767 %%%% Setup the cval values. This is relevant only to colormap mode.
770 if numel(self.workspace.cval) == 0
771 self.workspace.cval = repmat(1 : self.nell, self.npnt, 1);
772 if ~pm.array.
len(self.axes.colorScale)
773 self.axes.colorScale = "log";
775 elseif numel(self.workspace.cval) == 1
776 % 2D plot in 3D visualization at a non-zero z value.
777 self.workspace.cval = self.workspace.cval * ones(self.npnt, self.nell);
778 elseif size(self.workspace.cval, 1) == self.npnt && size(self.workspace.cval, 2) == 1
779 % The corresponding points on all ellipsoids have the same z values.
780 self.workspace.cval = repmat(self.workspace.cval, 1, self.nell);
781 elseif size(self.workspace.cval, 1) == 1 && size(self.workspace.cval, 2) == self.nell
782 % All points on each ellipse have the same z values.
783 self.workspace.cval = repmat(self.workspace.cval, self.npnt, 1);
784 elseif size(self.workspace.cval, 1) ~= self.npnt || size(self.workspace.cval, 2) ~= self.nell
786 disp("size(self.workspace.cval)")
787 disp( size(self.workspace.cval) )
788 disp("[self.ndim, self.nell]")
789 disp( [self.ndim, self.nell] )
791 + "The shapes of the specified ``cval`` is incompatible with" + newline ...
792 + "the inferred number of ellipsoids ``nell`` in the input self.workspace." + newline ...
793 + "For more information, see the documentation of the ``cval`` component displayed above." + newline ...
799 %%%% Check the consistency of shape of ``self.ellindex``.
802 if ~isempty(self.ellindex)
803 self.workspace.ellindex = self.ellindex(:);
805 self.workspace.ellindex = pm.array.
logrange(1, self.nell, 75);
809 %%%% Generate column indices.
812 fields = ["colx", "coly", "colz", "colc"];
813 for icol = 1 : length(fields)
814 field = fields(icol);
815 self.(field) = length(fields) * ((1 : length(self.workspace.ellindex) * numel(self.workspace.dimx)) - 1) + icol;
819 %%%% Generate ellipse self.workspace.
822 gramtmp = zeros(2, 2);
823 bcrd = zeros(size(self.workspace.zval, 1), length(fields) * length(self.workspace.ellindex) * numel(self.workspace.dimx));
824 for idim = 1 : numel(self.workspace.dimx)
825 for iell = 1 : length(self.workspace.ellindex)
826 jell = self.workspace.ellindex(iell);
827 icol = (iell - 1) * length(fields) + 1;
828 iset = (idim - 1) * length(fields) * length(self.workspace.ellindex);
829 dimxy = [self.workspace.dimx(idim), self.workspace.dimy(idim)];
830 if self.workspace.dimx(idim) ~= self.workspace.dimy(idim)
831 gramtmp(:, :) = self.workspace.gramian(dimxy, dimxy, jell);
833 sigmasq = self.workspace.gramian(self.workspace.dimx(idim), self.workspace.dimx(idim), jell);
834 gramtmp(:, :) = [sigmasq, 0; 0, sigmasq];
836 bcrd(:, iset + icol : iset + icol + 1) = pm.geom.ell2.
getBorder ( gramtmp ...
837 , self.workspace.center(dimxy, jell) ...
838 , size(self.workspace.zval, 1) ...
840 bcrd(:, iset + icol + 2) = self.workspace.zval(:, jell);
841 if 3 < length(fields)
842 bcrd(:, iset + icol + 3) = self.workspace.cval(:, jell);
848 %%%% Generate the dataframe.
851 self.dfref = pm.container.
DataFrame(bcrd);
857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
859 methods(Access = public)
862 %> Generate a plot from the selected dimensions
863 %> of the input ellipsoid data to the
object constructor.<br>
866 %> This method is pure, except for the changes in ``fout`` component.<br>
869 %>
which is **implicitly** passed to this dynamic method (not by the user).<br>
870 %> \param[in] varargin : Any ``property, value`` pair of the parent
object.<br>
871 %> If the property is a ``struct()``, then its value must be given as a cell array,
872 %> with consecutive elements representing the struct ``property-
name, property-value`` pairs.<br>
873 %> Note that all of these property-value pairs can be also directly set via the
874 %> parent
object attributes, before calling the ``make()`` method.<br>
879 %> pm.vis.SubplotEllipse3.make();
880 %> pm.vis.SubplotEllipse3.make(varargin);
892 %> \JoshuaOsborne, May 22 2024, 5:46 PM, University of Texas at Arlington<br>
893 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
894 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
895 function make(self, varargin)
897 make@pm.vis.SubplotLineScatter3(self, varargin{:});
899 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
900 %%%% RULE 0: No component of ``self`` is allowed to appear to the left of assignment
operator, except ``fout``.
901 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
903 if self.colormap.enabled && self.colorbar.enabled
904 if prod(self.workspace.shape.cval) < 1
905 % input cval is empty
906 %self.fout.colorbar.Ticks = self.fout.axes.ZTick;
907 %%self.fout.colorbar.Limits = self.fout.axes.ZLim;
908 ylabel(self.fout.colorbar,
"Ellipsoid Index");
910 ylabel(self.fout.colorbar,
"Color Data");
918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function verify(in varval, in vartype, in varsize, in varname)
Verify the type and number of elements of the input varval match the specified input vartype and vars...
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 abstract class for generating instances of objects that contain the specifications of a c...
This is the abstract class for generating instances of objects that can contain basic attributes requ...
This is the abstract class for generating instances of objects that can contain basic attributes requ...
This is the base class for generating instances of objects that contain the specifications of various...
This is the SubplotEllipse3 class for generating instances of 3-dimensional Ellipse Subplot visualiza...
function make(in self, in varargin)
Generate a plot from the selected dimensions of the input ellipsoid data to the object constructor.
function premake(in self, in varargin)
Prepare the subplot for visualization.
function reset(in self, in varargin)
Reset the properties of the plot to the original default settings.
function SubplotEllipse3(in gramian, in center, in zval, in cval, in varargin)
Construct and return an object of class pm.vis.SubplotEllipse.
This is the SubplotEllipse class for generating instances of 2-dimensional Ellipse Subplot visualizat...
This is the SubplotLineScatter3 class for generating instances of 3-dimensional Line-Scatter Subplot ...
This is the abstract class for generating instances of axes with various types of plots from one or m...
This is the abstract class for generating instances of objects that contain the specifications of var...
This is the base class for generating instances of figures containing a square symmetric tiling of su...
function clean()
Remove all paths that contain the ParaMonte lib directory from the MATLAB path variable.
function copy(in from, in to, in field, in exclude)
Copy the contents of the struct/object from to the struct/object to recursively and without destroyin...
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 getKeyVal(in key, in hashmap)
Return the value corresponding to the input key in the input hashmap cell array.
function len(in obj)
Return a scalar MATLAB whole-number containing the length of the input scalar or vector object.
function logrange(in start, in stop, in sizemax)
Return a set of maximum sizemax unique integer spacings almost linearly spaced in the natural logarit...
function map()
Return a scalar MATLAB logical that is true if and only if the current installation of MATLAB contain...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...