save figure with slider
3 views (last 30 days)
Show older comments
Dear Matlab Central community,
I have a measurement class "Osc", which plots results out in a figure with a slider:
function nthReturn( obj, varargin )
fignumber = readin_varargin('fignumber', 42, varargin, 'double');
f1=figure(fignumber);
set(f1, 'Toolbar','figure', 'Name', obj.label, 'Filename', generateFilename(obj.label), 'numbertitle', 'off');
pos = get(f1,'Position');
set(f1,'Position',[pos(1)-(800-pos(3)) pos(2)-(600-pos(4)) 800 600]);
% Slider
sh = uicontrol(f1,'Style','slider','Max',1,'Min',0,'Value',1,'SliderStep',[0.001 0.01],'Units','normalized');
SliderHPosition = get(sh,'Position'); %sh = slider handle shpos = position of slider handle
set(sh,'Position',[0 0 1 SliderHPosition(4)]);
callbackfct = @(~,~,~) obj.nthReturnSingle('sliderValue', get(sh, 'Value'), 'figHandle', f1, varargin{:});
set(sh, 'Callback', callbackfct);
callbackfct();
end
here 'obj.nthReturnSingle(...)' is a method of the class that produces the single plot. Everything works like a charm and I can easily go through the different measurement values with the slider, but, if I then hit "File->save" in the figure, it produces a huge file containing all slides (not only the active one).
This will kill my HDD quickly. Is there a simple way to tell matlab to only save the active image as *.fig?
Thanks a lot,
Michael
0 Comments
Answers (0)
See Also
Categories
Find more on Install Products in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!