How to globally set the default font for contour labels?
4 ビュー (過去 30 日間)
古いコメントを表示
I found out how to globally set defaults for Matlab's graphics fonts by setting, for example:
set(groot,'defaultTextFontName','Times New Roman')
so I changed the defaultTextFontName to, for instance, 'Times New Roman', yet when I plot a contour the labels still use Hellvetica (pun intended :)
As far as I understand (which is not that far), the labels belong to the 'Text' class, but using the 'defaultTextFontName' property has no effect:
set(groot,'defaultTextFontName','Times New Roman')
[x,y,z] = peaks;
[C,h] = contour(x,y,z);
clabel(C,h)
although setting it locally does work:
[x,y,z] = peaks;
[C,h] = contour(x,y,z);
clabel(C,h,'FontName','Times New Roman')
How can I globally change the contour label font?
0 件のコメント
回答 (1 件)
Ishu
2024 年 2 月 6 日
Hi Phelype,
As "clabel" attributes are specific to contour plot only, and are produced after the contour plot is produced so according to me you will not be able to set these parameters globally. I have checked setting other defaults globally using "set" that are not specific to only contour plot and that is achieved without any error. Like you can gobally set "FontSize", "FontWeight" or "TextColor" that are not specific to only some plots:
set(0, 'DefaultTextFontSize', 10);
set(0, 'DefaultTextFontWeight', 'bold');
set(0, 'DefaultTextColor', 'blue');
set(0, 'DefaultLineMarkerSize', 30);
Below are MathWorks documentation that you can refer to:
contour plot - https://www.mathworks.com/help/matlab/ref/contour.html
Hope it helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!