FUNCTION REFERENCE
exportgraphics
Export a figure to an image or vector file.
Export a figure to an image or vector file.
Syntax
exportgraphics(gcf, 'plot.png')Syntax
exportgraphics(gcf, 'plot.png', 'Resolution', 300)Format comes from the extension: png, jpg, jpeg, tif, tiff, pdf or svg. Options: ContentType, Resolution, BackgroundColor (white, current or none). Call it as a statement.
Example
exportgraphics(gcf, 'plot.png', 'Resolution', 300) % writes plot.pngDifferences from MATLAB: Every format, SVG included, needs a build with the plot-export feature (on in the desktop build); without it every call errors. EPS is not accepted. Append, Colorspace, custom colors, sizes and padding are not supported; no output assignment.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.