Graphics Previous page   Next Page

Exporting to the Windows Clipboard

You can export a figure to the Windows clipboard using one of two graphics formats: EMF color vector or BMP 8-bit color bitmap.

By default, MATLAB chooses the graphics format for you, based on the rendering method used to display the figure. For figures rendered with OpenGL or Z-buffer, MATLAB uses the BMP format. For figures rendered with Painter's, the EMF format is used. For information about how MATLAB selects a rendering method, see The Default Renderer for MATLAB.

To override the selection by MATLAB, specify the format of your choice using either the Windows Copy Options Preferences dialog box, or the -d switch in the print command.

You can export to the clipboard:

Using the Graphical User Interface on Windows

Before you export the figure to the clipboard, you can use the Copy Options Preferences dialog box to select a nondefault graphics format, or to adjust certain figure settings. These settings become the new defaults for all figures exported to the clipboard.

To open the Copy Options Preferences dialog box, select Copy Options from the figure window's Edit menu. Any changes you make with this dialog box affect only the clipboard copy of the figure; they do not affect the way the figure looks on the screen.

Settings you can change in the Copy Options Preferences dialog box are as follows:

Clipboard format.   To copy the figure in EMF color vector format, select Metafile. To use BMP 8-bit color bitmap format, select Bitmap. Or, to have MATLAB select the format for you, select Preserve information. MATLAB uses the metafile format whenever possible.

Figure background color.   To keep the background color the same as it appears on the screen, select Use figure color. To make the background white, select Force white background. For a background that is transparent, for example, a slide background to frame the axes part of a figure, select Transparent background.

Size.   Select Match figure screen size to copy the figure as it appears on the screen, or leave it unselected to use the Page Setup settings to determine its size.

  1. Open the Copy Options Preferences dialog box if you need to make any changes to those preferences used in copying to the clipboard.
  2. Click OK to se the new preferences. These will be used for all future figures exported to the clipboard.
  3. Select Copy Figure from the figure window's Edit menu to copy the figure to the clipboard.

Using MATLAB Commands

Export to the clipboard using the print function with a graphics format, but no filename. You must use one of the following clipboard formats: -dbitmap or -dmeta. These switches create a Windows bitmap (BMP) or an enhanced metafile (EMF), respectively.

For example, to export the current figure to the clipboard in enhanced metafile format, type


Previous page  Exporting to a File Examples of Basic Operations Next page

© 1994-2005 The MathWorks, Inc.