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

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 Exchange에서 Creating, 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