Why am I unable to change the font size or rotate a label in MATLAB whose "FontName" property is set to "FixedWidth"?

3 vues (au cours des 30 derniers jours)
To view this behavior, enter the following command:
ylabel('mytext', 'FontName', 'FixedWidth', 'FontSize', '16')
You can observe that the y label is horizontal (when usually vertical), and the font size is less that 16.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 27 Juin 2009
This enhancement has been made for Release 14 SP1 (R14SP1). For previous product releases, read below for any possible workarounds:
The default fixed-width font is "Courier". This font is a bitmap that cannot be rotated or resized. To workaround this issue, set the default fixed-width font of the root object to be "Courier New" using:
set(0, 'FixedWidthFontName', 'Courier New');
Note that if you had initially executed the command:
ylabel('mytext', 'FontName', 'FixedWidth', 'FontSize', '16')
then "Courier" will be cached as the fixed-width font. Therefore, setting the default value of the root object will not affect the font.
To avoid this, it is best to place the above SET command within your startup.m file so that "Courier New" is the default fixed width font everytime you start MATLAB.

Plus de réponses (0)

Catégories

En savoir plus sur Labels and Annotations dans Help Center et File Exchange

Produits


Version

R13SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by