Graphics |
Background Color
When I output my figure, its background is changed to white. How can I get it to have the displayed background color?.
By default, when you print or export a figure, MATLAB inverts the background color to white. There are two ways to retain the displayed background color: use the Page Setup dialog box or set the InvertHardCopy
property to off
. See Setting the Background Color for instructions on either method.
If you are exporting your figure to the clipboard, you can also use the Copy Options panel of the Preferences dialog box. Setting the background here sets it for all figures copied to the clipboard.
Default Settings
I need to produce diagrams for publications. There is a list of requirements that I must meet for size of the figure, fonts types, etc. How can I do this easily and consistently?.
You can set the default value for any property by adding a line to startup.m
. As an example, the following line sets the default axes label font size to 12.
In your call to set
, combine the word Default
with the name of the object Axes
and the property name FontSize
.
Dimensions of Output
The dimensions of my output are huge. How can I make it smaller?.
Check your settings for figure size and resolution, both of which affect the output dimensions of your figure.
The default figure size is 8-by-6 inches. You can use the Page Setup dialog box or the PaperPosition
property to set the figure size. See Setting the Figure Size and Position.
The default resolution depends on the export format or printer driver used. For example, built-in MATLAB bitmap formats, like TIFF, have a default resolution of 150 dpi. You can change the resolution by using the print
function and the -r
switch. For default resolution values and instructions on how to change them, see Setting the Resolution.
I selected "Match Screen Size" from the Page Setup menu, but my output looks a little bigger, and my font looks different.
You probably output your figure using a higher resolution than your screen uses. Set your resolution to be the same as the screen's.
As an alternative, if you are exporting your figure, see if your application enables you to select a resolution. If so, import the figure at the same resolution it was exported with. For more information about resolution and how to set it when exporting, see Setting the Resolution.
Axis and Tick Labels
When I resize my figure below a certain size, my x-axis label and the bottom half of the x-axis tick labels are missing from the output.
Your figure size might be too small to accommodate the labels. Labels are positioned a fixed distance from the x-axis. Since the x-axis itself is positioned a relative distance away from the window's edge, the label text might not fit. Try using a larger figure size or smaller fonts. For instructions on setting the size of your figure, see Setting the Figure Size and Position. For information about setting font size, see the Text Properties reference page.
In my output, the x-axis has fewer ticks than it did on the screen.
MATLAB has rescaled your ticks because the size of your output figure is different from its displayed size. There are two ways to prevent this: select Keep screen limits and ticks from the Axes and Figure tab of the Page Setup dialog box, or set the XTickMode
, YTickMode
, and ZTickMode
properties to manual
. See Setting the Axes Ticks and Limits for details.
UI Controls
My figure contains UI controls. How do I prevent them from appearing in my output?.
Use the print
function with the -noui
switch. For details, see Excluding User Interface Controls.
Cropping
I can't output my figure using the uncropped setting (i.e., a loose BoundingBox).
Only PostScript printer drivers and the EPS export format support uncropped output. There is a workaround for Windows printer drivers, however. Using the print
function, save your figure to a file that can be printed later. For an example see Producing Uncropped Figures.
Text Object Font
I have a problem with text objects when printing with a PostScript printer driver or exporting to EPS. The fonts are correct on the screen, but are changed in the output.
You have probably used a font that is not supported by EPS and PostScript. All unsupported fonts are converted to Courier. See PostScript and Ghostscript Supported Fonts for the list of the supported fonts.
Exporting Problems | Handle Graphics Objects |
© 1994-2005 The MathWorks, Inc.