How to globally set the default font for contour labels?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Ishu
el 6 de Feb. de 2024
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 comentarios
Ver también
Categorías
Más información sobre Contour Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!