File format, specified as one of these options:
'fig'
— Save the figure
as a MATLAB figure file with the .fig
extension.
To open figures saved with the .fig
extension,
use the openfig
function. This format is not valid
for Simulink block diagrams.
'm'
or 'mfig'
—
Save the figure as a MATLAB figure file and additionally create
a MATLAB file that opens the figure. To open the figure, run
the MATLAB file. This option is not valid for Simulink block
diagrams.
Bitmap image file format — Specify the format
as one of the bitmap image options in the table, Bitmap Image Formats.
Vector graphics file format — Specify the format
as one of the vector graphics options in the table, Vector Graphics Formats.
Bitmap Image File
Bitmap images contain a pixel-based representation of the figure. The size of the generated
file depends on the figure, the format, and your system resolution.
Bitmap images are widely used by web browsers and other applications
that display graphics. However, they do not support transparency or
scale well and you cannot modify individual graphics objects (such as
lines and text) in other graphics applications.
Bitmap Image Formats
Option | Format | Default File Extension |
---|
'jpeg' | JPEG 24-bit | .jpg |
'png' | PNG 24-bit | .png |
'tiff' | TIFF 24-bit (compressed) | .tif |
'tiffn' | TIFF 24-bit (not compressed) | .tif |
'meta' | Enhanced metafile (Windows only) | .emf |
'bmpmono' | BMP Monochrome | .bmp |
'bmp' | BMP 24-bit | .bmp |
'bmp16m' | BMP 24-bit | .bmp |
'bmp256' | BMP 8-bit (256 color, uses a fixed colormap) | .bmp |
'hdf' | HDF 24-bit | .hdf |
'pbm' | PBM (plain format) 1-bit | .pbm |
'pbmraw' | PBM (raw format) 1-bit | .pbm |
'pcxmono' | PCX 1-bit | .pcx |
'pcx24b' | PCX 24-bit color (three 8-bit planes) | .pcx |
'pcx256' | PCX 8-bit newer color (256 color) | .pcx |
'pcx16' | PCX older color (EGA/VGA 16-color) | .pcx |
'pgm' | PGM (plain format) | .pgm |
'pgmraw' | PGM (raw format) | .pgm |
'ppm' | PPM (plain format) | .ppm |
'ppmraw' | PPM (raw format) | .ppm |
Vector Graphics File
Vector graphics files store commands that redraw the figure.
This type of format scales well, but can result in a large file. In
some cases, a vector graphics format might not produce the correct
3-D arrangement of objects. Some applications support extensive editing
of vector graphics formats, but others do not support editing beyond
resizing the graphic. The best practice is to make all the necessary
changes while your figure is still in MATLAB.
Typically, saveas
uses the Painters renderer when generating vector
graphics files. For some complex figures, saveas
uses
the OpenGL® renderer instead. If it uses the OpenGL renderer, then the vector graphics file contains an
embedded image, which might limit the extent to which you can edit the
image in other applications. Also, if saveas
uses
the OpenGL renderer to generate the file, then transparency is not
supported. To ensure that saveas
uses the Painters
renderer, set the Renderer
property for the figure to 'painters'
.
If you set the Renderer
property for the figure, then saveas
uses
that renderer. Otherwise, it chooses the appropriate renderer. However,
if saveas
chooses a renderer that differs from
the renderer used for the figure on the display, then some details
of the saved figure can differ from the displayed figure. If necessary,
you can make the displayed figure and the saved figure use the same
renderer by setting the Renderer
property for the figure.
Vector Graphics Formats
Option | Format | Default File Extension |
---|
'pdf' | Full page Portable Document Format (PDF) color | .pdf |
'eps' | Encapsulated PostScript® (EPS) Level 3 black and white | .eps |
'epsc' | Encapsulated PostScript (EPS) Level 3 color | .eps |
'eps2' | Encapsulated PostScript (EPS) Level 2 black and white | .eps |
'epsc2' | Encapsulated PostScript (EPS) Level 2 color | .eps |
'meta' | Enhanced Metafile (Windows only) | .emf |
'svg' | SVG (scalable vector graphics) | .svg |
'ps' | Full-page PostScript (PS) Level 3 black and white | .ps |
'psc' | Full-page PostScript (PS) Level 3 color | .ps |
'ps2' | Full-page PostScript (PS) Level 2 black and white | .ps |
'psc2' | Full-page PostScript (PS) Level 2 color | .ps |
Note
Only PDF and PS formats use the PaperOrientation
property
of the figure and the left
and bottom
elements
of the PaperPosition
property. Other formats ignore
these values.