Printing and Exporting Figures with MATLAB    

Setting the Rendering Method

A renderer is software and/or hardware that processes graphics data (such as vertex coordinates) in order to display, print, or export a figure. MATLAB supports three rendering methods:

For more detailed information about the rendering methods, see renderer in the "Figure Properties" reference pages.

Comparing Rendering Methods

The OpenGL and Z-buffer methods draw figures using bitmap (raster) graphics. The Painter's method draws figures using vector graphics. In general, Painter's produces higher-resolution results than OpenGL or Z-buffer. However, OpenGL and Z-buffer work in situations where Painter's either produces inaccurate results or does not work at all.

For many figures, it is possible to use any of the rendering methods. There are certain situations, however, where only one or two methods will work:

The Default Renderer for MATLAB

By default, MATLAB automatically selects the best rendering method, based on the attributes of the figure (its complexity and the settings of various Handle Graphics properties) and in some cases, the printer driver or file format used.

Attributes of the Figure

In general, MATLAB uses:

Printer Driver or Format

The following table summarizes the default renderer(s) used for each printer driver or format, and which rendering methods are supported.

Renderers Supported by Drivers and Formats

Format or Printer Driver
Default Renderer
Which Renderer Setting Can be Used
All Printer Drivers except HPGL
Depends on the figure's attributes
OpenGL, Z-buffer, Painter's
HPGL
Painter's
Painter's. If you use another setting, Painter's will be used instead.
Bitmap formats (e.g. TIFF, BMP)
Screen renderer.
OpenGL or Z-buffer. OpenGL is used if the operating system supports it.
EPS and EMF vector formats
Depends on the figure's attributes
Painter's is preferable, but you can use OpenGL or Z-buffer. See "Reasons for Changing the Renderer" below.

Reasons for Changing the Renderer

The rendering method used for printing and exporting the figure is not always the same method used to display the figure. The most important reason to set the renderer before printing or exporting is to make your printed or exported figure look the same as it did on the screen.

Another reason to set the renderer is to avoid unintentionally exporting your figure as a bitmap within a vector format. For example, MATLAB typically renders high complexity plots using OpenGL or Z-buffer. If you print or export a high complexity figure to the EPS or EMF vector formats without specifying a rendering method, MATLAB might use OpenGL or Z-buffer, which create bitmap graphics.

Storing a bitmap in a vector file can generate a very large file that takes a long time to print. If you use one of these formats and want to make sure that your figure is saved as a vector file, be sure to set the rendering method to Painter's.

How to Set the Renderer

The rendering method for printing and exporting can only be set on a per figure basis. Use one of the following:

Using Page Setup

  1. Select Page Setup from the figure window's File menu. This invokes the Page Setup dialog box.
  2. Select the Axes and Figure tab.
  3. Under Figure Renderer, select the desired rendering method from the list box.
  4. Click OK to accept the new setting, or Cancel to close the dialog box without changing.

Using MATLAB Commands

You can use the Renderer property or a switch with the print command to set the renderer for printing or exporting. These two lines each set the renderer for the current figure to Z-buffer.

or

The first example saves the new value of Renderer with the figure; the second example only affects the current print or export operation.

Note that when you set the Renderer property, the RendererMode property is automatically reset from auto (the factory default) to manual.


 Fine-Tuning Your Output Setting Resolution