Does anyone know if it's possible to automatically write a figure out to a .eps file in MATLAB?
I'm running a script that produces a large number of graphs, and it'd be nice if I didn't have to manually save each one!
To save the current figure, specify fig as gcf . saveas( fig , filename , formattype ) creates the file using the specified file format, formattype .
Save Current Figure to FIG-File To open the saved figure, use the command: openfig('PeaksFile. fig'); MATLAB creates a new figure using the saved .
figure( n ) finds a figure in which the Number property is equal to n , and makes it the current figure. If no figure exists with that property value, MATLAB® creates a new figure and sets its Number property to n .
print function does that:
Print figure or save to specific file format...
print(filename,formattype)
saves the current figure to a file using the specified file format, such asprint('BarPlot','-dpng')
. If the file name does not include an extension, then print appends the appropriate one.
print(filename,formattype,formatoptions)
specifies additional options that are available for some formats.
print or saveas will do the trick.
saveas(fig_handle, 'filename','eps')
print('-deps',fig_handle)
print -deps 1
If you want to specify the output file name, you're better off using saveas.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With