Graphics    

Printing to a File

Instead of sending your figure to the printer right now, you have the option of "printing" it to a file, and then sending the file to the printer later on. You can also append additional figures to the same file using the print command.

This section tells you how to save your figure to a file

Using the Graphical User Interface on Windows

  1. To open the Print dialog box, select Print from the figure window's File menu.
  2. Select the check box labeled Print to file, and click on the OK button.
  3. The Print to File dialog box appears, allowing you to specify the output directory and filename.

Using the Graphical User Interface on UNIX

  1. To open the Print dialog box, select Print from the figure window's File menu.
  2. Select the radio button labeled File, and either fill in or browse for the directory and filename.

Using MATLAB Commands

To print the figure to a PostScript file, type

If you don't specify the filename extension, MATLAB uses an extension that is appropriate for the print driver being used.

You can also include an -options argument when printing to a file. For example, to append the current figure to an existing file, type

The only way to append to a file is by using the print function. There is no dialog box that enables you to do this.

Appending Additional Figures to a File.   Once you have printed one figure to a PostScript file, you can append other figures to that same file using the -append option of the print function. You can only append using the print function.

This example prints Figure No. 2 to PostScript file, myfile.ps, and then appends Figure No. 3 to the end of the same file.


  How to Print or Export Exporting to a File