Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Axis labels on boxplot

Subject: Axis labels on boxplot

From: Daniel Robbins

Date: 4 Jul, 2012 14:25:08

Message: 1 of 1

I have writen the code posted below. The axis labels for the barchart work perfectly, however for the boxplot the category labels do not show. Is there some issue with using " set(gca,'xticklabel',{'0.5','0.75','1'}) " for boxplots?

subplot (3,1,1);
bar(channelsmean) % consider using bar (data_array, 'grouped') to give more info -
hold on
errorbar(xlength,channelsmean,l,matvar,'r')
title ('Comparison of Epochs')
h=get(gca,'title');
set(h,'fontSize',13)
set(gca,'xticklabel',{'0.5','0.75','1'})
xlabel('Epoch')
h=get(gca,'xlabel'); % This obtains axis label data & provides variable name for reference.
set(h,'fontSize',12) % This edits axis label font size.
ylabel('Mean MCV')
h=get(gca,'ylabel');
set(h,'fontSize',12)
hold off
subplot(3,1,2);
bar(totmean)
hold on
errorbar(1,totmean,0,x,'r')
title ('Over All Mean')
h=get(gca,'title');
set(h,'fontSize',13)
set(gca,'xticklabel',{'Mean of epochs'})
ylabel('Mean MCV')
h=get(gca,'ylabel');
set(h,'fontSize',12)
hold off
subplot(3,1,3);
boxplot(channelsmatrix)
hold on
title ('Box Plot')
h=get(gca,'title');
set(h,'fontSize',13)
set(gca,'xticklabel',{'0.5','0.75','1'})
xlabel('Seconds in Epoch')
h=get(gca,'xlabel');
set(h,'fontSize',12)
ylabel('MCV')
h=get(gca,'ylabel');
set(h,'fontSize',12)
hold off

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us