How to turn off text interpreter when plotting timeseries objects
显示 更早的评论
My variable names include underscores (e.g. 'ABC_DEF') and I do not want these interpreted as LATEX (no subscripts).
It works fine on a single plot:
ts = timeseries((1:10)',randn(10,1),'Name','ABC_DEF');
figure
plot(ts)

But when you do subplots the interpreter seems to be set to LaTex:
figure
subplot(2,1,1); plot(ts)
subplot(2,1,2); ts.plot()

This answer explains how to change the interpreter for individual text commands but I can't find anything on this for timeseries plots.
采纳的回答
更多回答(1 个)
Use a space and backslash between ABC _ DEF when interpreting variables.
Latex treats text after _ subscript
ts = timeseries((1:10)',randn(10,1),'Name','ABC\_DEF');
figure
plot(ts)
figure
subplot(2,1,1); plot(ts)
subplot(2,1,2); ts.plot()
类别
在 帮助中心 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!