exit \fontname in label

5 次查看(过去 30 天)
franco otaola
franco otaola 2021-10-13
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by