How can I change the fontface of a text within a plot
300 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
jjlivestrong
am 30 Sep. 2012
Kommentiert: Image Analyst
am 27 Jan. 2024
Quick question, can I change the font face on MATLABs plot to other not being Arial (At least I think the default style is Arial).
If I were to change it to Times New Roman, what must I do?
Can you please help?
Akzeptierte Antwort
Walter Roberson
am 30 Sep. 2012
Bearbeitet: Walter Roberson
am 7 Apr. 2018
title() and *label() accept 'FontName' property/value pairs. You can also use a FontName property/value pair in an axes() call, or you can set() that.
Note that if you set() an axes fontname, then http://www.mathworks.com/help/matlab/ref/axes_props.html
"Note that MATLAB does not display the x-, y-, and z-axis labels in a new font until you manually reset them (by setting the XLabel, YLabel, and ZLabel properties or by using the xlabel, ylabel, or zlabel command). Tick mark labels change immediately."
0 Kommentare
Weitere Antworten (2)
Matt Fig
am 30 Sep. 2012
get(gca,'fontname') % shows you what you are using.
set(gca,'fontname','times') % Set it to times
0 Kommentare
Image Analyst
am 30 Sep. 2012
Bearbeitet: Image Analyst
am 30 Sep. 2012
For example:
text(.10,.2, 'Hello World', 'FontName', 'Impact', 'FontSize', 40, 'Color', [.5 0 1]);
Should work with title(), xlabel(), and ylabel() also.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!