Printing and Exporting Figures with MATLAB | ![]() ![]() |
Example - Exporting an EMF to the Clipboard
This example uses the clipboard to export a figure to an EMF file. The settings made to the figure before it is copied to the clipboard include applying a template, increasing the font size, and setting the size for the exported figure. The instructions refer to using the graphical user interface, then show how to perform the same operations using MATLAB commands.
x = -pi:0.01:pi; [h] = plot(x,sin(x)); title('Sine Plot');
The MATLAB-suggested settings for PowerPoint are added to the template.
Some of the fields in the panel update to show the settings. For example, the
PowerPoint template increases the font size.
These are recommended settings. You can change them to anything you want.
If you don't like the way your figure looks with the new settings, restore it to its original settings by clicking the Restore button.
In the Copy Options pane, select Metafile so that MATLAB will export the figure to the clipboard as a metafile.
To do the same tasks using MATLAB commands, use
x = -pi:0.01:pi; [h] = plot(x,sin(x)); title('Sine Plot'); set(gca,'FontWeight','bold'); newsize = get(gca,'FontSize')*1.4; set(gca,'FontSize',newsize); % Set size of axes labels. set(get(gca,'Title'),'FontSize',newsize); % Set size of title. set(h,'LineWidth',4); set(gca,'XTickMode','Manual','YTickMode','Manual','ZTickMode', 'manual'); set(gcf, 'PaperPositionMode', 'manual'); set(gcf, 'PaperPosition', [0 0 10 7.5]); set(gcf,'Color','None'); %Set background to transparent. print -dmeta -painters %Copy to clipboard
Figure 4-9: Figure with Transparent Background Copied to a Slide
![]() | Setting Copy Preferences | Exporting Using MATLAB Commands | ![]() |