
3 Graphics
• The Print option displays a dialog box that le ts you cho ose a pri nter, sele ct
standard printing options, and print the figure.
Use Print Preview to determine w hether the prin ted output is what you
want. Click the Print Preview dialog b ox Help button to display information
on how to set up the page.
See“PrintingtheGraph”onpage3-42foranexampleofprintingfrom
the Print Preview dialog. For details on printing from GUIs and from the
Command Window, see “Printing and Exporting” in the MATLAB Graphics
documentation.
Exporting the Figure to a Graphics File
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 s ave as graphics files. The Export Setup GUI lets you define and apply
templates to customize and standardize output. After setup, you can export
thefiguretoanumberofstandardgraphicsfileformatssuchasEPS,PNG,
and TIFF.
See “Exporting the Graph” on page 3-46 for an example of exporting a figure
to a graphics file.
Using the Print Command
The print commandprovidesmoreflexibilityinthetypeofoutputsenttothe
printer and allo ws you to control printing from M-files. The result can be se nt
directly to your default printer or stored in a specified file. A wide variety o f
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 w ord 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:
3-72
Commentaires sur ces manuels