help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: imwrite or print


From: Francesco Potortì
Subject: Re: imwrite or print
Date: Thu, 11 Jun 2020 11:47:21 +0200

>t = linspace(0,2*pi,100)';
>plot(t,sin(t));
>tic;print -dpng "-S560,420" fig_print.png;toc
>tic;imwrite(getframe(gcf).cdata,"fig_imwrite.png");toc
>
>I could not find any differences between both files (fig_print.png and 
>fig_imwrite.png).

>From the getframe definition:
     Without an argument, capture the current axes excluding ticklabels,
     title, and x/y/zlabels.  The returned structure FRAME has a field

So once you add (for example) a title you should see the difference.

>However imwrite is much faster than print

That's interesting and may be useful when saving many images.

>1) Is imwrite always faster than print ?

Probably: print does much more

>2) Is there any situation where one command should be used instead of the 
>other one?

print is for general use, imwrite only creates bitmap files from a
single plot with the above limitations

-- 
Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
(gate 20, 1st floor, room C71)         Web:    http://fly.isti.cnr.it



reply via email to

[Prev in Thread] Current Thread [Next in Thread]