How to save an open figure in an specified path?
1 view (last 30 days)
Show older comments
How can I save a file with the "print"? here is my code:
figNums=findobj(0,'type','figure');
for h=figNums
set(h,'paperunits','centimeters');
set(h,'paperposition',[w(1) w(2) a(1) a(1)*a(2)]);
textobj=findobj('type','text');
set(textobj,'fontunits','points');
set(textobj,'fontsize',w(3));
set(findall(h,'property','fontsize'),'fontsize',w(3));
set(gca,'fontsize',w(3));
set(findall(gca,'type','text'),'fontsize',w(3));
set(findall(h,'type','text'),'fontsize',w(3));
%new_name=strrep(p,'.fig','.png');
child=get(h,'children');
for y=1:length(child)
chi=child(y);
set(chi,'fontsize',w(3));
end
print(h,'-dpng','-r300')
end
running the program at the print line I get:
Warning: Files produced by the 'png' driver cannot be sent to printer. File saved to disk under name 'figure1.png'.
how can I save the job in .png format and in a path,that user gives. is there any "uiget" for such a thing?
0 Comments
Answers (1)
See Also
Categories
Find more on Software Development Tools 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!