Axis labels - subscripts not working
古いコメントを表示
Morning all,
could you please help me with subscripts in axis labels?
When I use code:
figure(1);
title('Generation change')
xlabel('Time [sec]')
ylabel('ΔP_G [pu]')
legend('ΔP_G for 1%','ΔP_G for 5% ','Location','southeast');
Everything is working.

However, when I use "plot" command, subsrcipt on y axis is not working anymore:
figure(1);
plot(PT1);
hold on;
plot(PT2);
grid on;
title('Generation change')
xlabel('Time [sec]')
ylabel('ΔP_G [pu]')
legend('ΔP_G for 1%','ΔP_G for 5% ','Location','southeast');

Data I am using is timeseries from Simulink. Subscripts in legend are working in both cases. Thanks in advance.
採用された回答
その他の回答 (1 件)
I heard back. This was an intentional setting change introduced with Timeseries. The work around for now is to manually override the axis label interpreter setting:
PT1 = timeseries(rand(5,1));
PT2 = timeseries(rand(5,1));
figure(2)
plot(PT1)
hold on
plot(PT2)
hold off
grid on
title('Generation change')
xlabel('Time [sec]')
ylabel('ΔP_G [pu]')
legend('ΔP_G for 1%','ΔP_G for 5% ','Location','southeast')
% set YLabel interpreter back to 'tex'
ax = gca;
ax.YLabel.Interpreter = 'tex';
1 件のコメント
dpb
2023 年 5 月 13 日
"...This was an intentional setting change introduced with Timeseries.:"
Just saw the latest plea from the wilderness and this follow-up, @Cris LaPierre. Why on earth would anybody choose to have done this dastardly deed? I can see no justification could possibly be to have done.
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



