|
I hope you still have some use with this answer!
set(gca,'XTick',1:3,'XTickLabel',{'label1';'label2';'label3'})
"Aldo Amaya" <aamaya4@uic.edu> wrote in message <j2eso0$84p$1@newscl01ah.mathworks.com>...
> Hi HTH,
>
> The code worked great, however, it does not allowed me to add labels like before.
>
> My previous code was :
>
> figure
> hold
> subplot(1,3,1)
> boxplot([M_GO M_NOGO3], 'notch';'on';...
> 'labels';{'Go','No Go'})
> ylabel('Reaction Time(ms)')
> xlabel('GO vs NOGO')
> title('GO vs NOGO RT Anova')
>
>
>
>
>
>
> Adapting it to your solution it now reads as:
>
> figure
> hold
> subplot(1,3,1)
> hold
> group = [ones(size(M_GO)); ones(size(M_NOGO3))+1];
> x = cat(1,M_GO,M_NOGO3);
> boxplot(x,group), ...
> 'labels';{'Go','No Go'};
> ylabel('Reaction Time(ms)')
> xlabel('GO vs NOGO')
> title('GO vs NOGO RT Anova')
>
> %%%However, my labels still only show 1 and 2 %%%%
>
>
>
> Could you help me to solve this minor problem, please? Thank you.
>
>
> "Anon" wrote in message <h1fqmd$1e9$1@fred.mathworks.com>...
> > Hi Valentina,
> >
> > try following:
> > group = [ones(size(t1);ones(size(t2))+1;ones(size(t3))+2];
> > x = cat(1,t1,t2,t3);
> > boxplot(x,group);
> >
> > HTH
> >
> >
> >
> > "Valentina " <vrossett82@gmail.com> wrote in message <h1fme2$3nn$1@fred.mathworks.com>...
> > > Hi,
> > > I would like to create a box plot of my samples, but these samples have different sizes. I can combine all the samples in just one vector and then use grouping variables, but I don't understand how they work. so for example, if I have 3 samples t1,t2 and t3 of lengths 43,148,228 respectively, how would the function boxplot be filled in? Something like boxplot(cat(1,t1,t2,t3),....)?
> > >
> > > Thank you very much!
> > >
> > > Valentina
|