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

  1. Select Print from the figure window's File menu. This invokes the Print dialog box.
  2. Select a printer, from the Name list, which is of the same type as the one to which you will later print the figure.
  3. Select the Print to File check box.
  4. Click OK. This invokes the Print to File dialog box.
  5. Enter a filename, preceding it with a pathname if you do not want the file saved to the current directory.
  6. Click OK to save the file.

From the UNIX Menus

  1. Select Print from the figure window's File menu. This invokes the Print dialog box.
  2. 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.
  3. Use the Driver scroll list to select a MATLAB printer driver for the type of printer to which you will later print the figure.
  4. Click OK to save the file.

From the Command Line

This example prints the figure in PostScript format to a file called 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.


 Printing to a Printer Using GhostScript Appending a Figure to a PostScript File