Access Keys:
Skip to content (Access Key - 0)

How can I print a plot or block diagram?

On this page:

MATLAB plots

The Matlab "print" command can be used either to print the current plot to a printer or to save the plot to a file.

The Matlab command:

        >> print -Pprintername

will send the current plot to the printer "printername". If you have multiple plot windows, you can select the window to print with the "-fhandle" or "-fwindow_title" option. For example, to print Figure No. 2, you can use

        >> print -f2 

Simulink Block Diagrams

To print a Simulink block diagram, use the "-ssystem" option. For example, to print the Simulink block diagram entitled "f14"

        >> print -sf14

will print it to the default printer. The command

        >> print -dps

will save the current plot to the file "".

Multiple plots in a file

To save multiple plots in one file, use the "-append" option. For example, the following sequence shows how to save and print 3 plots in one file called "":

           >> plot(sin([0:25]*2*pi/25));
           >> print -dps
           >> plot(sin([0:25]*4*pi/25));
           >> print -dps -append
           >> plot(sin([0:25]*8*pi/25));
           >> print -dps -append

Then to print to the Pharos printers, use the lpr command at the athena prompt:

           athena%  lpr -Pmitprint

The "print" command supports a number of output types including:

           -dps    - PostScript for black and white printers
           -dpsc   - PostScript for color printers
           -deps   - Encapsulated PostScript (EPSF)
           -depsc  - Encapsulated Color PostScript (EPSF)

Type "help print" at the Matlab prompt for more information on the options available for the print command.

IS&T Contributions

Documentation and information provided by IS&T staff members

Last Modified:

December 19, 2012

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
matlab-review matlab-review Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
This product/service is:
Easy to use
Difficult to use

This article is:
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki