MATLAB Functions Help Desk

print, printopt

Purpose

Create hardcopy output

Syntax

Description

print and printopt produce hardcopy output. All arguments to the print command are optional. You can use them in any combination or order.

print sends the contents of the current Figure, including any user interface controls, to the printer using the device and system print command defined by printopt.

print -devicetype specifies a device type, overriding the value returned by printopt. The "Devices" section lists all supported device types.

print -options specifies print options that modify the action of the print command. (For example, the -noui option suppresses printing of user interface controls.) The "Options" section lists available options.

print filename directs the output to the file designated by filename. If
filename does not include an extension, print appends an appropriate extension, depending on the device (e.g., .eps). If you omit filename, print sends the file to the default output device (except for -dmeta and -dbitmap, which place their output on the clipboard).

[pcmd,dev] = printopt returns strings containing the current system-dependent print command and output device. printopt is an M-file used by print to produce the hardcopy output. You can edit the M-file printopt.m to set your default printer type and destination.

pcmd and dev are platform-dependent strings. pcmd contains the command that print uses to send a file to the printer. dev contains the device options for the print command. Their defaults are platform-dependent.

Platform

pcmd

dev

UNIX (except Silicon Graphics)

lpr -r -s

-dps2

Silicon Graphics

lp

-dps2

VMS

PRINT/DELETE

-dps2

Windows

COPY /B %s LPT1:

-dwin

Macintosh

(not applicable)

-dps2

Devices

The table below lists device types supported by MATLAB's built-in drivers. Generally, Level 2 PostScript files are smaller and render more quickly when printing than Level 1 PostScript files. However, not all PostScript printers support Level 2, so determine the capabilities of your printer before using those devices.

Device

Description

-dps

Level 1 black and white PostScript

-dpsc

Level 1 color PostScript

-dps2

Level 2 black and white PostScript

-dpsc2

Level 2 color PostScript

-deps

Level 1 black and white Encapsulated PostScript (EPS)

-depsc

Level 1 color Encapsulated PostScript (EPS)

-deps2

Level 2 black and white Encapsulated PostScript (EPS)

-depsc2

Level 2 color Encapsulated PostScript (EPS)

-dhpgl

HPGL compatible with HP 7475A plotter

-dill

Adobe Illustrator 88 compatible illustration file

-dmfile

M-file, and MAT-file when appropriate, containing Handle Graphics commands to re-create the Figure and its children

This table lists additional devices supported via the Ghostscript post-processor, which converts PostScript files into other formats. (This feature is not available on Macintosh systems.)

Device

Description

-dlaserjet

HP LaserJet

-dljetplus

HP LaserJet+

-dljet2p

HP LaserJet IIP

-dljet3

HP LaserJet III

-dljet4

HP LaserJet 4 (defaults to 600 dpi)

-ddeskjet

HP DeskJet and DeskJet Plus

-ddjet500

HP Deskjet 500

-dcdeskjet

HP DeskJet 500C with 1 bit/pixel color

-dcdjmono

HP DeskJet 500C printing black only

-dcdjcolor

HP DeskJet 500C with 24 bit/pixel color and high-quality color (Floyd-Steinberg) dithering

-dcdj500

HP DeskJet 500C

-dcdj550

HP Deskjet 550C

-dpaintjet

HP PaintJet color printer

-dpjxl

HP PaintJet XL color printer

-dpjetxl

HP PaintJet XL color printer

-dpjxl300

HP PaintJet XL300 color printer

-ddnj650c

HP DesignJet 650C

-dbj10e

Canon BubbleJet BJ10e

-dbj200

Canon BubbleJet BJ200

-dbjc600

Canon Color BubbleJet BJC-600 and BJC-4000

-dln03

DEC LN03 printer

-depson

Epson-compatible dot matrix printers (9- or 24-pin)

-depsonc

Epson LQ-2550 and Fujitsu 3400/2400/1200

-deps9high

Epson-compatible 9-pin, interleaved lines (triple resolution)

-dibmpro

IBM 9-pin Proprinter

-dbmp256

8-bit (256-color) BMP file format

-dbmp16m

24-bit BMP file format

-dpcxmono

Monochrome PCX file format

-dpcx16

Older color PCX file format (EGA/VGA, 16-color)

-dpcx256

Newer color PCX file format (256-color)

-dpcx24b

24-bit color PCX file format, three 8-bit planes

-dpbm

Portable Bitmap (plain format)

-dpbmraw

Portable Bitmap (raw format)

-dpgm

Portable Graymap (plain format)

-dpgmraw

Portable Graymap (raw format)

-dppm

Portable Pixmap (plain format)

-dppmraw

Portable Pixmap (raw format)

-dbit

A plain "bit bucket" device

-dbitrgb

Plain bits, RGB

-dbitcmyk

Plain bits, CMYK

This table summarizes additional devices available on Windows systems.

Device

Description

-dwin

Use Windows printing services (black and white)

-dwinc

Use Windows printing services (color)

-dmeta

Copy to clipboard in Enhanced Windows metafile format

-dbitmap

Copy to clipboard in Windows bitmap (BMP) format

-dsetup

Display Print Setup dialog box, but do not print

-v

Verbose mode to display Print dialog box (suppressed by default)

This table summarizes additional devices available on Macintosh systems.

Device

Description

-dpict

Create PICT file

-v

Verbose mode to display Print dialog box (suppressed by default)

Options

This table summarizes printing options that you can specify when you enter the print command.

Option

Description

-epsi

Add 1-bit deep EPSI preview to EPS

-loose

Use loose bounding box for EPS and PS

-cmyk

Use CMYK colors in PostScript instead of RGB

-append

Append to existing PostScript file without overwriting

-rnumber

Specify resolution in dots per inch

-adobecset

Use PostScript default character set encoding

-Pprinter

Specify printer to use

-fhandle

Handle of a Figure graphics object to print

-swindowtitle

Name of SIMULINK system window to print

-painters

Render using painter's algorithm

-zbuffer

Render using Z-buffer

-noui

Suppress printing of user interface controls

Example

This command saves the contents of the current Figure as Level 2 color Encapsulated PostScript in the file called meshdata.eps:

See Also

orient, figure

See the Using MATLAB Graphics manual for detailed information about printing in MATLAB.



[ Previous | Help Desk | Next ]