Writing x values with subscript in the graph
1 回表示 (過去 30 日間)
古いコメントを表示
Dear all,
I want to writing x values with subscript in the graph as follows:![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/564496/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/564496/image.jpeg)
Here is my code:
data=xlsread('boxplot');
col_header={'GA_{343}','GA351','GA352','GA342','GA153','GA353','GA141','GA273','GA143','GA373'};
data=data';
boxplot(data,col_header)
xlabel('Algorithm')
ylabel('Fitness Value')
How can I do this. Also, I use MATLAB 2020a version.
Thanks.
0 件のコメント
採用された回答
dpb
2021 年 3 月 27 日
hAx=gca; % save the axes handle -- may want later
hAx.TickLabelInterpreter='tex'; % set tick label interpreter
Then your first column label will show the subscript; the answer for the rest is then apparent...
See the section on 'interpreter' optional named parameter at
doc text
for the details of TeX interpreter syntax.
6 件のコメント
dpb
2021 年 3 月 28 日
Told ya'! :)
Glad to help; as noted earlier, the syntax rules for TeX are documented under text for future reference when want to get fancy again... :) Otherwise, it's kinda' hard to find in the doc if don't know/remember that.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!