Printing and Exporting Figures with MATLAB    

Using the Windows User Interface

  1. Select Print from the figure window's File menu. This invokes the Print dialog box.
  2. Select the Print to File check box.
  3. Click OK. This invokes the Print to File dialog box.
  4. Enter a filename, preceding it with a pathname if you do not want the file saved to the current directory.
  5. Click OK to save the file or Cancel to close the dialog box without printing to file.

Using the UNIX User Interface

  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.
  3. If you need to specify a directory other than the current directory, use the Browse button to navigate to the desired directory.
  4. Use the Driver scroll list to select a MATLAB printer driver.
  5. Click OK to print or Cancel to close the dialog box without printing.

For more information on using the UNIX Print dialog box, see its context sensitive help by clicking its Help button.

Using the print Command

The syntax for printing to a file is

where -device is set to a driver that is compatible with the printer you want to send it to later. See the reference page for print for the list of drivers.

For example, this call to print creates a file named mydata that can later be printed to an HP LaserJet III.

This example prints to a file that can be printed by any Level II color PostScript driver,


 Printing to a File Appending Figures to a PostScript File