フィルターのクリア

format the x-axis in a boxplot

1 回表示 (過去 30 日間)
Seldeeno
Seldeeno 2017 年 8 月 22 日
回答済み: KL 2017 年 8 月 24 日
Hi,
I am trying to format my x-axis in an boxplot such that part of an xtick appears with superscript and italic. So far its not working. Any help plz?
a1=xlsread('a1.xlsx','50D','L2:L52');
a2=xlsread('a2.xlsx','50D','L2:L52');
a3=xlsread('a3.xlsx','50D','L2:L52');
a3_2=xlsread('a3_2.xlsx','50D','L2:L52');
a3_3=xlsread('a3_3.xlsx','50D','L2:L52');
a3_4=xlsread('a3_4.xlsx','50D','L2:L52');
a5=xlsread('a5.xlsx','50D','L2:L52');
a4=xlsread('a4.xlsx','50D','L2:L52');
all=[a1; a2; a3; a3_2; a3_3; a3_4; a4; a5];
set(0,'DefaultAxesFontName', 'Arial');
set(0,'DefaultAxesFontSize', 8);
g = [repmat({'a1'}, length(a1), 1); repmat({'a2'}, length(a2), 1); repmat({'a3'},length(a3), 1);repmat({'a3_2'}, length(a3_2), 1);repmat({'a3_3'}, length(a3_3), 1); repmat({'a3_4'}, length(a3_4), 1); repmat({'a4'}, length(a4), 1); repmat({'a5'}, length(a5), 1)];
set(gca,'TickLabelInterpreter','latex');
set(gca,'XTickLabel',{'a1', 'a2', 'a3', 'a3_2', 'a3_3', 'a3_4','a4','Da\itSin-\rmDE+α^{*}'});
boxplot(all,gca,'symbol','bo','width',0.5);

回答 (1 件)

KL
KL 2017 年 8 月 24 日
set(gca,'FontAngle', 'italic') %for italics
set(gca,'XTickLabel',{'$$a3_{1}$$','$$a3_{2}$$'}); %for subscripts

Community Treasure Hunt

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

Start Hunting!

Translated by