|
Avri Alony <avrialony@gmail.com> wrote in message <b4531394-b3a3-4420-a1d8-fbbda2f34c2e@m38g2000vbn.googlegroups.com>...
> saving figure of scatter(X,Y,250,M,'filled') my manual (File - Save as
> - filename.tif (TIFF no compression image)) generate exactly the same
> image as in figure.
>
> saving the figure by script: saveas(gca,'filename.tiff','tiff'); gave
> different image compare to original figure, for example - the dot-size
> change to be smaller.
>
> How to save by script and keep the image to be exactly as the original
> figure ?
Try this code:
function screen2tiff(fig,filename)
oldscreenunits = get(fig,'Units');
oldpaperunits = get(fig,'PaperUnits');
oldpaperpos = get(fig,'PaperPosition');
set(fig,'Units','pixels');
scrpos = get(fig,'Position');
newpos = scrpos/100;
set(fig,'PaperUnits','inches',...
'PaperPosition',newpos)
print('-dtiffn', filename, '-r100');
drawnow
set(fig,'Units',oldscreenunits,...
'PaperUnits',oldpaperunits,...
'PaperPosition',oldpaperpos)
source:
http://www.mathworks.com/support/solutions/en/data/1-16WME/?solution=1-16WME
Grzegorz
|