Printing and Exporting Figures with MATLAB | ![]() ![]() |
Exporting Using MATLAB Commands
This section discusses how to use the print
command to perform exporting operations and then introduces some of the options for overriding default behavior.
The most basic export syntax is,
where -format
is set to one of the supported graphics formats (such as TIFF or EPS) and filename is the name (optionally including a pathname) you assign to your exported file. This syntax outputs your figure using the default settings.
To override default export behavior, you can use the syntax,
where options
can specify the renderer to use, the resolution, or a format-specific option. You can specify multiple options
and they can be placed in any order.
Specifying the Format to Use
There is no factory default for file format when using the print
command. Set the -format
argument to the appropriate switch. To find the appropriate switch setting, look up the format you would like to use in the Table 4-1, Export Formats and Export-Only Options,. The command switches are shown in the third column. For help in deciding which format to use, see How to Choose a File Format.
Specifying a Default Format
While your "factory default version" of MATLAB does not specify a default format, you can create one yourself.
Default Format for Exporting to File. To change the default, replace the default printer driver specified in printopt.m
with a file format. For example, if printopt.m
specifies,
and you want to set a default format of TIFF, edit the line to read
Be sure to change it back to a printer driver again before trying to print figures. See Editing printopt.m for more information.
Default Format for Exporting to the Clipboard. To change the default clipboard format for all copy operations, use the Copy Options Preferences panel of the Preferences dialog box. See Setting Copy Preferences.
![]() | Example - Exporting an EMF to the Clipboard | Specifying Options | ![]() |