How can I use equations in x- and y-labels with common fonts.

16 次查看(过去 30 天)
I like a defult font type that can be shown when I command
plot(blah-blah-blah);
xlabel('ABCD');
However, when I want to input some equations in a label, I use the following codes
plot(blah-blah-blah);
xlabel('Number of nodes, $\vert\mathcal{N}\vert$','Interpreter','latex');
What matters to me is the difference of the fonts.
Actually, I prefer the font for the above one to the font for the below one.
Is there a way to get the same font as the above with using latex formulae?
  2 个评论
KALYAN ACHARJYA
KALYAN ACHARJYA 2019-6-29
Considering you are pointing text font type, if not let me know?
t=1:.1:10;
figure, plot(exp(t));
xlabel('ABCD','FontName','Times New Roman');
t=1:.1:10;
figure, plot(exp(t));
xlabel('ABCD, $\vert\mathcal{N}\vert$','Interpreter','latex','FontName','Times New Roman');
KALYAN ACHARJYA
KALYAN ACHARJYA 2019-6-29
Danny's Comment:
When the interpreter is tex, varios font can be applied.
In other words, the below codes give different results to me.
xlabel('ABCD, $\vert\mathcal{N}\vert$','Interpreter','tex','FontName','Times New Roman');
xlabel('ABCD, $\vert\mathcal{N}\vert$','Interpreter','tex','FontName','Helvetica');
However, once I set the interpreter to latex, the fontname is not applied.
In other words, the below codes give the same result.
xlabel('ABCD, $\vert\mathcal{N}\vert$','Interpreter','latex','FontName','Times New Roman');
xlabel('ABCD, $\vert\mathcal{N}\vert$','Interpreter','latex','FontName','Helvetica');

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by