Graphics |
 |
Printing a Figure to a File
This example shows you how to print a figure to a file for later printing. By default, the figure is saved in your current directory.
From the Windows Menus
- Select Print from the figure window's File menu. This invokes the Print dialog box.
- Select a printer, from the Name list, which is of the same type as the one to which you will later print the figure.
- Select the Print to File check box.
- Click OK. This invokes the Print to File dialog box.
- Enter a filename, preceding it with a pathname if you do not want the file saved to the current directory.
- Click OK to save the file.
From the UNIX Menus
- Select Print from the figure window's File menu. This invokes the Print dialog box.
- Set Destination to File and enter a filename in the Name field. If you need to specify a directory other than the current directory, use the Browse button to navigate to the desired directory.
- Use the Driver scroll list to select a MATLAB printer driver for the type of printer to which you will later print the figure.
- Click OK to save the file.
From the Command Line
This example prints the figure in PostScript format to a file called myfigure.ps
.
print myfigure.ps;
This example uses GhostScript to print the figure to a file named myfigure.jet
that can later be printed to an HP LaserJet III. MATLAB adds the appropriate file extension.
print -dljet3 myfigure;
| Printing to a Printer Using GhostScript | | Appending a Figure to a PostScript File |  |