Graphics    

Driver-Specific Information

This section provides additional information about the various types of printer drivers available to MATLAB users. It covers the following topics:

Setting the Windows Driver

When you specify a Windows driver (-dwin or -dwinc), MATLAB interprets this to mean that the print request will use the Windows Print Manager. It also means that MATLAB will assign the default Windows driver based on your current printer's color property setting. In other words, MATLAB does not differentiate between -dwin or -dwinc in printopt.m and you might not get the expected output color.

There are two ways to ensure that MATLAB uses -dwin or -dwinc: specify the driver when you print, or use the Windows Document Properties dialog box to set the default driver.

You can use the printer's Document Properties dialog box to set the default driver for all print requests. This dialog box sets the printer's color property, which in turn sets the default Windows driver.

To access this dialog box, click the Options button on the Windows Print or Print Setup dialog box. See your Windows documentation if you need help with this dialog box. Document Properties dialog boxes vary from printer to printer. The figure below shows an example of one.

Windows Document Properties Dialog Box for an HP LaserJet 5Si

Correcting Color Results with Windows Drivers

Sometimes, even when you use the Windows Document Properties dialog box, you can receive incorrect color results because some Windows printers return inaccurate information about their color property setting.

If this happens, you can use the figure window's Preferences dialog box to override the color property. This setting is used as the default setting for all future print operations:

  1. Select Preferences from the figure window's File menu or from the File menu on the MATLAB command window.
  2. Select General Preferences.
  3. Under the Figure Window Printing panel, select Always send as color.
  4. Click OK.

Trouble with Native Drivers on Windows

Occasionally, printing problems are due to a bug in the native printer driver or an incompatibility between the native printer driver and the MATLAB driver.

If you are having trouble, try installing a different native printer driver. A newer version may be available from the manufacturer or from a different vendor. You may also be able to use the native driver from a different printer, such as an earlier model from the same manufacturer.

If this doesn't help, try using a PostScript or Ghostscript driver.

Level 1 or Level 2 PostScript Drivers

Choosing between the Level 1 or Level 2 MATLAB PostScript drivers does not affect the quality of your output. Make the choice based on what your printer supports and on any file size or speed concerns.

Level 1 PostScript produces good results on a Level 2 printer, but Level 2 PostScript will not print properly on a Level 1 printer.

Level 2 PostScript files are generally smaller and render more quickly than Level 1 files. If your printer supports Level 2 PostScript, use one of the Level 2 drivers. If your printer does not support Level 2, or if you're not sure, use a Level 1 driver.

Early PostScript 1 Printers

If you have an early PostScript 1 printer, such as some of the PostScript printers manufactured before 1990, you may notice problems in the text of MATLAB printouts. Your printer may not support the ISOLatin1Encoding operator that MATLAB uses for PostScript files. If this is the case, use Adobe's PostScript default character-set encoding:

Background Fills in HPGL Drivers

The HPGL driver cannot do background fills. Therefore, you should ensure that your figure is set to print with a white background (the default), and that any lines and text in your figure will be drawn in a color dark enough to be seen on a white background. For more information about background color, see Setting the Background Color.

Color Selection in HPGL Drivers

The HP 7475A plotter supports six pens, none of which can be white. If MATLAB tries to draw in white while rendering in HPGL mode, the driver ignores all drawing commands until a different color is chosen.

Pen 1, which is assumed to be black, is used for drawing axes. The remaining pens are used for the first five colors specified in the ColorOrder property of the current axes object. If ColorOrder specifies fewer than five colors, the unspecified pens are not used.

For Simulink systems, which ordinarily use a maximum of eight colors, the six pens available on the plotter are assumed to be

If you attempt to draw a MATLAB object containing a color that is not a known pen color, the driver chooses the nearest approximation to the unlisted color.

Limitations of HPGL Drivers

The HPGL driver has these limitations:

How to Specify the Printer Driver to Use

If you need to use a driver other than the default driver for your system, choose a new driver from the Printer Driver table on the print reference page, and set it either as a new default or just for the current figure you are working on.

Setting the Default Driver for All Figures

If you do not indicate a specific printer driver, MATLAB uses the default driver specified by the variable dev in the printopt.m file. The factory default driver depends on the platform.

Platform
Factory Default Printer Driver
Driver Code
Windows
Black-and-white Windows
-dwin
UNIX
Black-and-white Level II PostScript
-dps2

To change the default driver for all figures, edit printopt.m and change the value for dev to match one of the driver codes listed in the Printer Drivers table on the print reference page. See Setting Defaults Across Sessions for instructions.

Setting a Driver for the Current Figure Only

You can change the printer driver using a UNIX dialog box or from the MATLAB command line.

Using the Graphical User Interface on UNIX.   To specify a printer driver for the current figure:

  1. From the figure window's File menu, select Print.
  2. Select a printer driver from the Driver list.
  3. Click OK to print your figure.

Using MATLAB Commands.   To specify a nondefault printer driver for the figure you are printing, include the -d switch with the print command. For example, to print the current figure using the MATLAB built-in Windows color printer driver, winc, type


  Factors to Consider in Choosing a Driver Troubleshooting