exit \fontname in label

9 vues (au cours des 30 derniers jours)
franco otaola
franco otaola le 13 Oct 2021
Hello,
I wanted to use a custom font only for a part of a label inside an axis label. for this I followed the following workflow https://fr.mathworks.com/matlabcentral/answers/95987-how-can-i-use-different-fonts-within-one-axis-label-in-matlab-7-13-r2011b
using something like this:
xlabel('part 1 \fontname{Cambria Math} part2\rm part3')
to get the part 2 with cambira math font and the rest in the default font (lets say arial), this works fine. the issue i am getting is that when I change the label to for example to Calibri (from the gui or by using set(findall(gcf,'-property','FontName'),'FontName','Calibri') ) I will get a half result.
what I mean, I will get the part1 in calibri, the part2 in cambira math and part 3 will stay in cambira math eventhought that I add the '\rm' part. the behavior I am looking for would be that part1 and 3 will the two of them change to the one used in the set function (or in the GUI). is this possible?
thanks

Réponses (0)

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by