Save jpg Files Under Plot Title Name

3 views (last 30 days)
I have a collection of simple plots with the titles displaying:
Indiana
Montana
Texas
Arizona
I need to take these plots and save the plots as jpg files by their TITLE name in a folder named States:
Folder:States
Indiana.jpg
Montana.jpg
Texas.jpg
Arizona.jpg
Thanks,
Amanda

Accepted Answer

Sean de Wolski
Sean de Wolski on 16 May 2013
doc saveas %or print
doc get
doc sprintf
Gte the string from the title of the axes:
For example:
figure;axes;plot(magic(20));title('Happy Thursday');
saveas(gcf,sprintf('%s.jpg',get(get(gca,'title'),'string')))

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!