Graphics |
 |
Exporting a Figure to the Clipboard
Export a figure to the clipboard in graphics-format when you want to paste it into another Windows application such as a word processor:
From the Windows Menus
This example exports a figure to the clipboard in Enhanced MetaFile (EMF) format. Figure settings are chosen that would make the exported figure suitable for use in a PowerPoint slide. Note that changing the settings modifies the figure displayed on the screen:
- Create a figure containing text. You can use the following code.
x = -pi:0.01:pi;
[h] = plot(x,sin(x));
title('Sine Plot');
- Select Preferences from the figure window's File menu. Then select Figure Copy Template from the Preferences dialog box.
- In the Figure Copy Template Preferences panel, click the PowerPoint button. The MATLAB suggested settings for PowerPoint are added to the template.

- In the Lines group box, change the Custom width to 4 points.
- In the Uicontrols and axes group box, select Keep axes limits and tick spacing to prevent MATLAB from possibly rescaling ticks and limits when you export.
- Click Apply to Figure. The changes appear in the figure window.
If you don't like the way your figure looks with the new settings, you can
restore it to its original settings by clicking the Restore button.
- In the left pane of the Preferences dialog box, expand the Figure Copy Template topic. Select Copy Options.
- In the Copy Options pane, select Metafile to tell MATLAB to export the figure in EMF format.
- Check that Transparent background is selected. This choice makes the figure background transparent and allows the slide background to frame the axes part of the figure.
- Deselect Match figure screen size so that you can use your own figure size settings.
- Click OK.
- Select Page Setup from the figure window's File menu.
- In the Size and Position tab, set Width to
10
and Height to 7.5
. Make sure that Units are set to Inches.
- Click OK.
- Select Copy Figure from the Edit menu. Your figure is now exported to the clipboard and can be pasted into another Windows application such as a PowerPoint slide.

From the Command Line
Use the print
command and one of two clipboard formats (-dmeta
, -dbitmap
) to export a figure to the clipboard. Do not specify a filename.
This example exports a figure to the clipboard in Enhanced Metafile (EMF) format.
print -dmeta
This example exports a figure to the clipboard in Bitmap (BMP) 8-bit color format.
print -dbitmap
| Exporting a Figure in EPS Format with a TIFF Preview | | Overview of Printing and Exporting |  |