Graphics | ![]() ![]() |
Printer Drivers
I'm using a Windows printer driver and have been encountering problems such as segmentation violations, general protection faults, application errors, and unexpected output.
Try one of the following solutions:
print
reference page to see if there are other drivers you can try. When I use the print command with the -deps switch, I receive this error message.
Encapsulated PostScript files cannot be sent to the printer. File saved to disk under name 'figure2.eps'
As the error message indicates, your figure was saved to a file. EPS is a graphics file format and cannot be sent to a printer using a printer driver. To send your figure directly to a printer, try using one of the PostScript driver switches. See the table of drivers in the print
reference page. To print an EPS file, you must first import it into a word processor or other software program.
Default Settings
My printer uses a different default paper type than MATLAB's default type of "letter." How can I change the default paper type so that I won't have to set it for each new figure?.
You can set the default value for any property by adding a line to startup.m
. Adding the following line sets the default paper type to A4.
set(0,'DefaultFigurePaperType','A4');
In your call to set
, combine the word Default
with the name of the object Figure
and the property name PaperType
.
I set the paper orientation to landscape, but each time I go to print a new figure, the orientation setting is portrait again. How can I change the default orientation so that I won't have to set it for each new figure?.
See the explanation for the question above. Adding the following line to startup.m
sets the default paper orientation to landscape.
set(0, 'DefaultFigurePaperOrient', 'landscape')
Printing Lines
My figure contains lines that use broken line styles. However, these lines print as solid lines.
Microsoft Windows 95 and Windows 98 do not support broken line styles for lines whose width is greater than 1 pixel. Unfortunately, most printers produce lines more than 1 pixel thick, so in most cases, Windows 95 and Windows 98 drivers produce solid lines, regardless of the setting of LineStyleOrder
.
There are various ways you can work around this problem.
[MATLAB Settings]
section of your MATLAB.INI
file:ThinLineStyles=1
This will result in thin lines, but the lines will print with the specified styles.
Renderer
property to OpenGL
: set(gcf,'Renderer','OpenGL')
The printed output will match the displayed figure. See Setting the Rendering Method for more information about the OpenGL renderer.
I want the lines in my figure to print in black but they keep printing in color.
You must be using a color printer driver. You can specify a black-and-white driver using the Print dialog box or print
command, or you can use the Page Setup dialog box to force the lines for the current figure to print in black. See Specifying Printed Color of Colored Lines and Text for instructions on either method.
A white line in my figure keeps coming out black when I print it.
There are two things that can cause this to happen. Most likely, the line is positioned over a dark background. By default, MATLAB inverts your background to white when you print, and changes any white lines over the background to black. To avoid this, retain your background color when you print. See Retaining Background Colors.
The other possibility is that you are using a Windows printer driver and the printer is sending inaccurate color information to MATLAB. See Correcting Color Results with Windows Drivers.
Printer
I am using a color printer, but my figure keeps printing in black and white.
By default, MATLAB uses a black-and-white printer driver. You need to specify a color printer driver. For instructions, see Printer Drivers. If you are already using a Windows color driver, the printer may be returning inaccurate information about its color property. See Correcting Color Results with Windows Drivers.
I have more than one printer connected to my system. How do I specify which one to print my figure with? .
Use the Print dialog box. On UNIX, you can also use the -P
switch with the print
command. For instructions using either method, see Selecting a Printer.
Rotated Text
I have some rotated text in my figure. It looks fine on the screen, but when I print it, the resolution is poor.
You are probably using bitmapped fonts, which don't rotate well. Try using TrueType fonts instead.
ResizeFcn Warning
I get a warning about my ResizeFcn being used when I print my figure.
By default, MATLAB resizes your figure when converting it to printer coordinates. Therefore, MATLAB calls any ResizeFcn
you have created for the figure and issues a warning. You can avoid this warning by setting the figure to print at screen size.
![]() | Troubleshooting | Exporting Problems | ![]() |