Thread Subject:
label each bar with it's value; bar graph

Subject: label each bar with it's value; bar graph

From: Monica He

Date: 3 Aug, 2012 22:59:22

Message: 1 of 4

Hiya,

I want to label every bar in my bar graph with the exact y-value.

I have a 3x7 array

num = [ 6.4000 10.8000 19.6000
                 1.2000 4.0000 6.4000
                 0.8000 1.8000 4.0000
                 0.2000 0.4000 1.8000
                 0.2000 0.2000 1.2000
                  0 0.2000 1.2000
                  0 0 0.4000 ];
bar(num);

and assorted legend/xlabel/ylabel/title.

I want to put 6.4, 10.8, 19.6 on the first three bars for the first x-division, 1.2, 4.0, 6.4 on the next three bars, etc.

Documentation for this is apparently pretty hard to find :(

Thanks for your time and help!
Monica

Subject: label each bar with it's value; bar graph

From: ImageAnalyst

Date: 4 Aug, 2012 18:56:33

Message: 2 of 4

Use the text() function to place a string atop each bar.

Subject: label each bar with it's value; bar graph

From: Monica He

Date: 6 Aug, 2012 18:05:09

Message: 3 of 4

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <d51f35f8-7a3f-4d63-95f4-9283ac652859@googlegroups.com>...
> Use the text() function to place a string atop each bar.

Thanks for your response!

I was hoping for a better way, as it's going to be done ~100 unique times. Know of any others? :)

Subject: label each bar with it's value; bar graph

From: Monica He

Date: 6 Aug, 2012 18:17:18

Message: 4 of 4

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <d51f35f8-7a3f-4d63-95f4-9283ac652859@googlegroups.com>...
> Use the text() function to place a string atop each bar.


Actually, you're right - found a nice ex
http://www.mathworks.com/matlabcentral/fileexchange/7401-scalable-vector-graphics-svg-export-of-figures/content/plot2svg_20120520/demo_svg_water.m
:D

Thanks!

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
bar graph Monica He 3 Aug, 2012 18:59:26
labels Monica He 3 Aug, 2012 18:59:26
bars Monica He 3 Aug, 2012 18:59:26
rssFeed for this Thread

Contact us