Printing and Exporting Figures with MATLAB | ![]() ![]() |
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.
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
opengl
command was called with selection_mode
set to neverselect
.
The following table summarizes the default renderer(s) used for each printer driver or format, and which rendering methods are supported.
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:
renderer
property or the print
command with a renderer switch
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.
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 | ![]() |