1 %> @brief GIF animation showing rotation of a 3D scatterplot
5 %> =[1, 2, 3] Index of features to be uses
as coordinates. Must be a 3-element vector.
7 %> =[] . Vector of confidence percentages (between 0 and 1)
for drawing the confidence ellipsoids. If left
8 %> empty, no confidence ellipsoid is drawn.
10 %> =0 . Whether or not to annotate the observation names ( @c
irdata::obsnames ) on the drawing. <b>Careful</b>:
11 %> figure may become quite jammed and MATLAB responsively slow
if there are over a thousand observations.
13 %> =-30:8:330 . Rotation angles in degrees
15 %> =
'' . If not specified: scatter3d<nnnn>.gif.
21 o.classtitle = '3D Scatterplot - GIF animation';
26 methods(Access=protected)
27 function out = do_use(o, obj)
32 p = get(h, 'Position');
34 % set(gca, 'Position', [0, 0, 1, 1]);
35 set(gcf, 'Color', 'w');
36 % set(h, 'Position', [.4, .4, .4+p(3)-p(1), .4+p(4)-p(2)]);
38 msgbox(sprintf('Please move and format the legend to your taste, then press Enter at the MATLAB command line.\nNote: don''t delete the legend.'));
40 input('Please press Enter when ready to record animated GIF ');
42 if isempty(o.filename)
49 for i = 1:length(o.rots)
50 set(gca, 'View', [o.rots(i), 30]);
51 frame = getframe(gcf);
55 [im, map] = rgb2ind(frame.cdata, 256, 'nodither');
56 im(1, 1, 1, length(o.rots)) = 0;
58 im(:, :, 1, i) = rgb2ind(frame.cdata, map, 'nodither');
60 imwrite(im, map, fn, 'DelayTime', 0, 'LoopCount', inf);
Property obsnames
(optional) [no]x[1] Cell of strings. Observation names (e.g. file names of the individual spectra) ...
GIF animation showing rotation of a 3D scatterplot.
Visualization base class.
function data_draw_scatter_3d(in data, in idx_fea, in confidences, in textmode)
Analysis Session (AS) base class.
function find_filename(in prefix, in suffix, in extension, in flag_return_ext)