Specifying Fonts and Character Sets
MATLAB figures support several kinds of text objects, such as titles, axis labels, and tick labels. This section discusses how to control the font and character set for text objects in figures so that the printed output uses the fonts you want.
Font characteristics are properties of axes, uicontrols, and text objects. For each of these objects, you can set these properties:
For example, to specify 10-point Helvetica-BoldOblique for the current axes:
set(gca,'FontName','Helvetica','FontSize',10,'FontUnits', ...
'points','FontWeight','bold','FontAngle','oblique')
Note that when MATLAB generates hardcopy output, it does not attempt to determine what fonts are available on the hardcopy device before it sends output to the device. If you specify a font that is not available on your printer, the printer will substitute another font. A PostScript printer will substitute Courier for any unavailable font.
MATLAB can generate PostScript output using the fonts listed below. These are the actual names you should use when you specify the FontName property for a text object:
If you use a font not on this list, MATLAB's PostScript driver substitutes Courier. This substitution affects the Ghostscript drivers as well, because they work by converting MATLAB's PostScript output.
Font properties for the axes object itself affect the x-, y-, and z-tick labels. Axis labels (XLabel, YLabel, and ZLabel) and Titles also use the axes font characteristics; however, you can set the font characteristics for these text objects explicitly to override the axes font values. For example, to change the font size of the Title, you could enter:
h = get(gca,'Title');
set(h,'FontSize',18);
The character set used for a text object is determined by its font. On most platforms, most fonts use the primary character set encoding for the platform. For PostScript output, you can also specify default PostScript character-set encoding by using the -adobecset option, as described on page 10-260.
[ Previous | Help Desk | Next ]