Subscript in stackedplot DisplayLabels
이전 댓글 표시
Hello everyone,
I'm trying to build a stacked plot with 3 graphs using Matlab 2018b's stackedplot-function. I'd like to write the corresponding DisplayLabels in TeX-style so that I can use subscripts, as can be done in regular plots without problem using e.g.
'T_{r}'
When I create a stackedplot using below code though, the labels are printed 'as is' instead of as a subscript:
s = stackedplot(f,If,'DisplayLabels',{'T_{r} = 50 ns','T_{r} = 20 ns','T_{r} = 10 ns'});

I've tried accessing Interpreter-properties and even setting
set(0,'defaultTextInterpreter','latex');
but couldn't get it to work as intended.
Can anyone please tell me how to do that?
Best regards
Sebastian
댓글 수: 4
Sebastian Sprunck
2019년 7월 29일
It looks like the handles to those labels aren't officially available. All you would need to do is set the "Interpreter" to "tex" which is normally the default interpreter for text but must not be the case here. Even findall() couldn't locate those handles. Maybe digging through the code will lead to an undocumented method of getting those handles but I couldn't get them otherwise.
Of course you could ditch the function and make your own subplots with identical x axes.
Sebastian Sprunck
2019년 7월 30일
Yeah, there are a few newer plotting functions that have a bunch of features on lockdown such as heatmap() and stackedplot(). I avoid using them which is unfortunate since they have some nice added features but when you can edit the basic, they become less useful.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

