Latex formatting on heatmaps (labels, title and all other text)
When creating a heatmap and a contour plot from the same table data with the code:
xvalues = {'20 $^\circ$C','30 $^\circ$C','40 $^\circ$C','50 $^\circ$C','60 $^\circ$C','70 $^\circ$C','80 $^\circ$C','90 $^\circ$C'}; yvalues = {'98 \%','90 \%','80 \%','70 \%','60 \%','50 \%','40 \%'};
c=heatmap(xvalues,yvalues,table) contourf(table)
set(gca,'xticklabel',xvalues) set(gca,'yticklabel',yvalues)
it turns out that my globally set latex formatting only affects the contour plot:
The heatmap keeps a default font while the contour plot shows the recognizable latex font. And all $...$ latex syntax is written out in clear text on the heatmap but correctly interpreted by the contour plot.
The MatLab code lines I use for applying latex formatting are put in the top of the live-script MatLab file that I am working in:
set(groot,'defaulttextinterpreter','latex'); set(groot, 'defaultAxesTickLabelInterpreter','latex'); set(groot, 'defaultLegendInterpreter','latex');
I am aware that those code lines might not target the "object", which the heatmap is. Any advice on how to apply the latex syntax on all text (labels, titles etc.) in all types of objects?
5 commentaires
Réponses (2)
0 commentaires
0 commentaires
Voir également
Catégories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!