Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

label (annotate) bar graph

8 views
Skip to first unread message

Wendy

unread,
Jan 5, 2010, 8:18:04 AM1/5/10
to
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

us

unread,
Jan 5, 2010, 8:26:02 AM1/5/10
to
"Wendy " <wlq...@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

0 new messages