Printing and Exporting Figures with MATLAB    

Retaining Background Colors

There are two types of background color settings in a figure: the axes background and the figure background. The default displayed color of both backgrounds is gray, but you can set them to any of several colors. This section shows you how to retain the displayed background colors in your output.

Default Background Colors

Regardless of the background colors in your displayed figure, by default, MATLAB always changes them to white when you print or export.

.

Figure 3-2: Default Background Printing Colors

How to Retain the Background Colors

To retain the background color on a per figure basis, use one of following:

To retain the background color for all figures, include the following line in your startup.m file:

If you are exporting your figure using the clipboard, use the Copy Options pane of the Preferences dialog box.

Using Page Setup

  1. Select Page Setup from the figure window's File menu.
  2. Open the Axes and Figure tab.
  3. Select Keep screen background color.
  4. Click OK to save this setting with the figure.

Using the InvertHardCopy Property

To retain your background colors use,

The following example sets the figure background color to blue, the axes background color to yellow, and then sets InvertHardCopy off so that these colors will appear in your printed or exported figure.


 How to Set the Resolution Locking the Ticks and Limits of the Axes