Hi everyone,
I was wondering if it is possible to save a figure without displaying it (because I do not have a graphic card on my working computer).
Thanks a lot !
|
|
0
|
|
|
|
Reply
|
rob6891
|
4/21/2010 10:12:27 AM |
|
"rob6891 C" <rob6891@hotmail.com> wrote in message <hqmj2b$pgd$1@fred.mathworks.com>...
> Hi everyone,
>
> I was wondering if it is possible to save a figure without displaying it (because I do not have a graphic card on my working computer).
>
> Thanks a lot !
Try this:
figure( h );
plot(....,'Visible',off);
hgsave(h,'filename');
close h;
If I remember correctly, when you open it elsewhere, you will have to set visibility to 'on' again.
h=open('filename.fig');
set(h,'visible','on')
|
|
0
|
|
|
|
Reply
|
vortse
|
4/21/2010 1:34:05 PM
|
|
Thanks a lot "vortse_a", I'm replying to your answer because I have the same problem. I have tried your suggestion, and it works.
Only, I would like that the figure, the .fig file, when double clicked, just simply be displayed in MATLAB without the need of issuing any command to activate visibility. As it works now, the .fig file, when doble clicked, produces no display.
So the final question, at least from my side, is: is it possible, in a batch program, to save a few figures without interacting with the screen at all? And the saved figures should be .fig (with graphics files, all is ok, for example .png works fine).
Best regards
|
|
0
|
|
|
|
Reply
|
Claudio
|
5/26/2010 8:41:07 AM
|
|
"Claudio Pedrazzi" <firstnameinitial.lastname@company.it> wrote in message <htimr3$fl1$1@fred.mathworks.com>...
> Thanks a lot "vortse_a", I'm replying to your answer because I have the same problem. I have tried your suggestion, and it works.
>
> Only, I would like that the figure, the .fig file, when double clicked, just simply be displayed in MATLAB without the need of issuing any command to activate visibility. As it works now, the .fig file, when doble clicked, produces no display.
>
> So the final question, at least from my side, is: is it possible, in a batch program, to save a few figures without interacting with the screen at all? And the saved figures should be .fig (with graphics files, all is ok, for example .png works fine).
>
> Best regards
one of the many solutions
tmpl='afig'; % <- the file name template...
for i=1:3
fnam=sprintf('%s_%2.2d',tmpl,i); % <- current file name...
clf;
plot(rand(10,1));
saveas(gcf,fnam,'fig');
end
dir('afig*.*');
% afig_01.fig afig_02.fig afig_03.fig
us
|
|
0
|
|
|
|
Reply
|
us
|
5/26/2010 10:06:03 AM
|
|
thanks us, probably I did not explain correctly what I'm looking for.
I would like to save without any plot activity on the screen!
Imagine the following scenario... a long MATLAB application, running "in background", needing now and then to save a few plots. The user on the PC is doing something else ... every plot command produces a popup window that interrupts any other activity, jumping in the foreground.
Your example, in my understanding, does work, and is familiar to me, but it opens a "figure" window 3 times. What I need is something like a "silent" saving of figure.
Best regards & thank you
Claudio
|
|
0
|
|
|
|
Reply
|
Claudio
|
5/26/2010 1:09:04 PM
|
|
"Claudio Pedrazzi" wrote:
> What I need is something like a "silent" saving of figure.
>> h = figure('Visible', 'off')
>> plot(rand(10,3));
>> set(h, 'Visible', 'on'); saveas(h, 'test.fig'); set(h, 'Visible', 'off');
|
|
1
|
|
|
|
Reply
|
Oliver
|
5/26/2010 1:38:05 PM
|
|
Claudio Pedrazzi wrote:
> Only, I would like that the figure, the .fig file, when double clicked,
> just simply be displayed in MATLAB without the need of issuing any
> command to activate visibility. As it works now, the .fig file, when
> doble clicked, produces no display.
That could happen if the stored figure happens to have 'Visible' set to
'off'. If so, then you cannot display it without using at least one
command at some point in time.
> So the final question, at least from my side, is: is it possible, in a
> batch program, to save a few figures without interacting with the screen
> at all? And the saved figures should be .fig (with graphics files, all
> is ok, for example .png works fine).
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/print.html
And search down to "Printing and Exporting without a Display"
|
|
0
|
|
|
|
Reply
|
Walter
|
5/26/2010 2:13:52 PM
|
|
|
6 Replies
1237 Views
(page loaded in 0.089 seconds)
Similiar Articles: How to save a figure without displaying ? - comp.soft-sys.matlab ...Hi everyone, I was wondering if it is possible to save a figure without displaying it (because I do not have a graphic card on my working computer)... How to save figure image as .png - comp.soft-sys.matlabHow to save a figure without displaying ? - comp.soft-sys.matlab ... How to save figure image as .png - comp.soft-sys.matlab How to save a figure without displaying ... Problems Saving a Matlab Figure - comp.soft-sys.matlabsave image without display - comp.soft-sys.matlab % 'Save picture as','default'); [filename, pathname] = uiputfile ... How to save a figure without displaying ? - comp ... Solution to saving a plot - comp.soft-sys.matlabHow to save a figure without displaying ? - comp.soft-sys.matlab ... Solution to saving a plot - comp.soft-sys.matlab How to save a figure without displaying ? - comp.soft ... Displaying ticks on only one side of a plot - comp.soft-sys.matlab ...How to save a figure without displaying ? - comp.soft-sys.matlab ... Only, I would like that the figure, the ... If so, then you cannot display it without using at least ... How to save to TIFF with CCITT Group 4 compression - comp.graphics ...How to save to TIFF with CCITT Group 4 compression - comp.graphics ... How to reduce a PDF figure size? - comp.text.pdf How to save a figure without displaying ? - comp ... Saving 'Visible','off' figures - comp.soft-sys.matlabHow to save a figure without displaying ? - comp.soft-sys.matlab ... Hi everyone, I was wondering if it is possible to save a figure ... Try this: figure( h ); plot ... problem with showing two figures at a time - comp.soft-sys.matlab ...How to save a figure without displaying ? - comp.soft-sys.matlab ..... replying to your answer because I have the same problem. ... is it possible, in a batch program ... problem with opening a *.fig file - comp.soft-sys.matlab ...How to save a figure without displaying ? - comp.soft-sys.matlab ... problem with opening a *.fig file - comp.soft-sys.matlab ... How to save a figure without displaying ... saving a figure at a set resolution - comp.soft-sys.matlab ...save image without display - comp.soft-sys.matlab saving a figure at a set resolution - comp.soft-sys.matlab ..... gcf,'papersize',[960,960]); > saveas(gcf,'image.jpg ... How to save a figure without displaying ? - comp.soft-sys.matlab ...Hi everyone, I was wondering if it is possible to save a figure without displaying it (because I do not have a graphic card on my working computer)... How to save a figure without displaying ? - Newsreader - MATLAB ...Hi everyone, I was wondering if it is possible to save a figure without displaying it (because I do not have a graphic card on my working computer). 7/20/2012 12:43:51 PM
|