Access Keys:
Skip to content (Access Key - 0)
 
More about this article
Created: 11/07/2008 10:33
Modified: 02/18/2009 02:32

How can I print a plot or block diagram?

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  filename.ps

will save the current plot to the file "filename.ps".

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 "example.ps":

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

Then to print example.ps to the printer ajax, use the lpr command at the athena prompt:

           athena%  lpr -Pajax example.ps

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.

Your Rating: Results: PatheticBadOKGoodOutstanding! 0 rates

Adaptavist Theme Builder Powered by Atlassian Confluence