| Contents | Index |
| On this page… |
|---|
You can print a MATLAB figure directly on a printer connected to your computer or you can export the figure to one of the standard graphics file formats that MATLAB supports. There are two ways to print and export figures:
Use the Print, Print Preview, or Export Setup GUI options under the File menu; see Preparing Graphs for Presentation for an example.
Use the print command to print or export the figure from the command line.
The print command provides greater control over drivers and file formats. The Print Preview dialog box gives you greater control over figure size, proportions, placement, and page headers. You can sometimes notice differences in output as printed from a GUI and as printed from the command line.
There are two menu options under the File menu that pertain to printing:
The Print Preview option displays a dialog box that lets you lay out and style figures for printing while previewing the output page, and from which you can print the figure. It includes options that formerly were part of the Page Setup dialog box.
The Print option displays a dialog box that lets you choose a printer, select standard printing options, and print the figure.
Use Print Preview to determine whether the printed output is what you want. Click the Print Preview dialog box Help button to display information on how to set up the page.
See Printing the Graph for an example of printing from the Print Preview dialog. For details on printing from GUIs and from the Command Window, see "Printing and Exporting" in the MATLAB Graphics documentation.
The Export Setup option in the File menu opens a GUI that enables you to set graphic characteristics, such as text size, font, and style, for figures you save as graphics files. The Export Setup GUI lets you define and apply templates to customize and standardize output. After setup, you can export the figure to a number of standard graphics file formats such as EPS, PNG, and TIFF.
See Exporting the Graph for an example of exporting a figure to a graphics file.
The print command provides more flexibility in the type of output sent to the printer and allows you to control printing from function and script files. The result can be sent directly to your default printer or stored in a specified output file. A wide variety of output formats, including TIFF, JPEG, and PostScript, is available.
For example, this statement saves the contents of the current figure window as color Encapsulated Level 2 PostScript in the file called magicsquare.eps. It also includes a TIFF preview, which enables most word processors to display the picture.
print -depsc2 -tiff magicsquare.eps
To save the same figure as a TIFF file with a resolution of 200 dpi, use the following command:
print -dtiff -r200 magicsquare.tiff
If you type print on the command line
the current figure prints on your default printer.
For More Information See the print reference page and Printing and Exporting in the MATLAB Graphics documentation for details about printing. |
![]() | Plotting Image Data | Understanding Handle Graphics Objects | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |