Figure axes not appearing when using tex syntax

Hello all, I recently got a new macbook and it seems that in the figure window I'm not able to display tex labels. For example, when I run this code:
x=1:100;
y=x/10^20;
plot(x,y);
xlabel('x_i');
ylabel('\theta');
This is the plot I would expect to get. However, what I actually get is
As you can see, no text formatting like I requested. I haven't had this issue on any other OS, so I'm wondering if this is Mac specific?
Note that other labels display perfectly. For example,
xlabel('x')
ylabel('y')
Displays without issues

2 件のコメント

Stephen23
Stephen23 2025 年 10 月 7 日
x = 1:100;
y = x./10.^20;
plot(x,y)
xlabel('x_i')
ylabel('\theta')
dpb
dpb 2025 年 10 月 7 日
編集済み: dpb 2025 年 10 月 7 日
Out of curiosity, what happens if you write
tiledlayout(2,2)
nexttile
xlabel('x_1','interpreter','tex')
ylabel('\theta','interpreter','tex')
text(0.5,0.5,'\theta x_1','interpreter','tex')
nexttile
xlabel('$x_{1}$','interpreter','latex')
ylabel('$\theta$','interpreter','latex')
text(0.5,0.5,['$\theta$ ' ' $x_{1}$'],'interpreter','latex')
?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

製品

リリース

R2025a

質問済み:

2025 年 10 月 7 日

編集済み:

dpb
2025 年 10 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by