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 Kommentare

x = 1:100;
y = x./10.^20;
plot(x,y)
xlabel('x_i')
ylabel('\theta')
dpb
dpb am 7 Okt. 2025
Bearbeitet: dpb am 7 Okt. 2025
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')
?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2025a

Gefragt:

am 7 Okt. 2025

Bearbeitet:

dpb
am 7 Okt. 2025

Community Treasure Hunt

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

Start Hunting!

Translated by