Save plot or graphics content to file
exportgraphics(
saves the contents of the graphics object specified by obj
,filename
)obj
to a file. The
graphics object can be any type of axes, a figure, a standalone visualization, a tiled chart
layout, or a container within the figure. The resulting graphic is tightly cropped to a thin
margin surrounding your content.
exportgraphics(
specifies additional options for saving the file. For example,
obj
,filename
,Name,Value
)exportgraphics(gca,'myplot.jpg','Resolution',300)
saves the contents of
the current axes as a 300-DPI image file.
Hovering over the Export button in the axes toolbar reveals a drop-down menu with options for
exporting content:
: Save the content as a tightly cropped image or
PDF.
: Copy the content as an image.
: Copy the content as a vector graphic.