I spent *far* too much time today figuring out how to put numbers in bar graphs. i.e. how to transform this:

into this:

When reading papers, I often wish numbers were included like this, and so resolved a while ago to always do so myself. Plotting the numbers allows someone else to replot them when doing some sort of a comparison. (With out needing to implement your algorithm, or ask you for your doubtlessly long-lost data, or (ugh) physically measuring the lengths of your bars.) However, now seeing how tedious this can be, I understand why it is rarely done.

In any case, I wrote a function add_bar_nums.m that you can run after doing a bar plot that will add the numbers like above. There are options for rotating the text, changing the display format, etc.

### Like this:

Like Loading...

*Related*

Just a different viewpoint. If those values are not so different, like in your example, why do you want to show a graph anyway? Why not just report numbers (e.g. in a table)? On the other hand, when values are so apparently different, a graph may not need numbers to be put on the bars. Anyway, your function add_bar_nums.m will be helpful as we can decide whether to put numbers or not🙂

I agree that graph is very boring! I’m not sure why the limits are set so poorly, either…

I really need to find a bar graph for my homework and I counting on this website to help me find it

.