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:
label (annotate) bar graph

Subject: label (annotate) bar graph

From: Wendy

Date: 5 Jan, 2010 13:18:04

Message: 1 of 2

I want to annotate my bars with the corresponding experimental conditions, far example, I have three samples on the same day for 4 days. I put the sample number on the x-axis. Can I label the date above each bar? Does anybody know any function file doing that?

Thank you.
Wendy

Subject: label (annotate) bar graph

From: us

Date: 5 Jan, 2010 13:26:02

Message: 2 of 2

"Wendy " <wlq121@gmail.com> wrote in message <hhve6c$aq6$1@fred.mathworks.com>...
> I want to annotate my bars with the corresponding experimental conditions, far example, I have three samples on the same day for 4 days. I put the sample number on the x-axis. Can I label the date above each bar? Does anybody know any function file doing that?
>
> Thank you.
> Wendy

one of the many solutions

     x=rand(1,3);
     xd={'jun','jul','aug'};
     nx=numel(x);
     bar(x);
     set(gca,'ylim',[0,1.2],'xticklabel',xd);
     text(1:nx,repmat(1.1,1,nx),xd,...
          'horizontalalignment','center',...
          'fontsize',12,...
          'fontweight','bold');

us

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