Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

save a plot

Asked by azarm on 17 Aug 2011

Hi Hi,

i have a problem with saving a plot in a directory as a figure(.tif). I have a main function. Each time i run my code, the code reaches a directory, takes image sequence and make some outputs. What i need to do, is to save some output plots in a directory. I know how to save a figure, but it does not work for plots! (specially i have a figure with hold on and i make plot inside the figure and want to save it!)

Thanks,

Azi

2 Comments

Oliver Woodford on 17 Aug 2011

It isn't clear to me what you are asking. Can you include code for a very simple example?

azarm on 17 Aug 2011

i meant : print('-dtiff','plot.tif')

azarm

Products

No products are associated with this question.

1 Answer

Answer by the cyclist on 17 Aug 2011
Accepted answer

Does this work for you?

plot(1:10)
print('-dtiff','plot.tif')

7 Comments

the cyclist on 17 Aug 2011

If you can create a variable with the full path to the directory, which you seem to be able to do, then you should be able to use

print('-dtiff',fullFileName)

as I said before. (I accidentally used double quotes instead of single quotes before.)

azarm on 17 Aug 2011

you're right! It works.
Tnx for your help

pedro rivera on 1 Apr 2013

your answer works, thanks

the cyclist

Contact us