Graphics |
|
Selecting a Renderer
A renderer is software and/or hardware that processes graphics data (such as vertex coordinates) to display, print, or export a figure. You can change the renderer that MATLAB uses when printing a figure:
Renderers Supported by MATLAB
MATLAB supports three rendering methods with the following characteristics:
Painter's
- Draws figures using vector graphics
- Generally produces higher resolution results
- The fastest renderer when the figure contains only simple or small graphics objects
- The only renderer possible when printing with the HPGL print driver or exporting to an Adobe Illustrator file
- The best renderer for creating PostScript or EPS files
- Cannot render figures that use RGB color for patch or surface objects
- Does not show lighting or transparency
Z-buffer
- Draws figures using bitmap (raster) graphics
- Faster and more accurate than Painter's
- Can consume a lot of system memory if MATLAB is displaying a complex scene
- Shows lighting, but not transparency
OpenGL
- Draws figures using bitmap (raster) graphics
- Generally faster than Painter's or Z-buffer
- In some cases, enables MATLAB to access graphics hardware that is available on some systems
- Shows both lighting and transparency
For more detailed information about the rendering methods, see Renderer
on the Figure Properties reference page.
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.
In general, MATLAB uses
- Painter's for line plots, area plots (bar graphs, histograms, etc.), and simple surface plots
- Z-buffer when the computer screen is not truecolor or when the
opengl
function was called with selection_mode
set to neverselect
- OpenGL for complex surface plots using interpolated shading and any figure using lighting
The RendererMode
property tells MATLAB whether to automatically select the renderer based on the contents of the figure (when set to auto
), or to use the Renderer
property that you have indicated (when set to manual
).
Reasons for Manually Setting the Renderer
Two reasons to set the renderer yourself are
- To make your printed or exported figure look the same as it did on the screen. The rendering method used for printing and exporting the figure is not always the same method used to display the figure.
- 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 export a high-complexity figure to the EPS or EMF vector formats without specifying a rendering method, MATLAB might use OpenGL or Z-buffer, each of which creates 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.
Using the Graphical User Interface
- Open the Page Setup dialog box by selecting Page Setup from the figure window's File menu. Select the Axes and Figure tab.
- Under Figure renderer, select the desired rendering method from the list box.
- Click OK.
Using MATLAB Commands
You can use the Renderer
property or a switch with the print
function 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
.
| Setting the Paper Orientation | | Setting the Resolution | |
© 1994-2005 The MathWorks, Inc.