format the x-axis in a boxplot

1 vue (au cours des 30 derniers jours)
Seldeeno
Seldeeno le 22 Août 2017
Réponse apportée : KL le 24 Août 2017
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);

Réponses (1)

KL
KL le 24 Août 2017
set(gca,'FontAngle', 'italic') %for italics
set(gca,'XTickLabel',{'$$a3_{1}$$','$$a3_{2}$$'}); %for subscripts

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by