Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65052

Including Sample Sizes in Bar Graphs Chart

$
0
0
Hi,

I am trying to create a bar graph using the following code:

Code:
graph bar (mean) twpcnhomicides, over(ldlvl) ///
subtitle("Average Annual Homicides Per 100,000""by Liberal Democracy Level") ///
ytitle ("Average Number Murdered Annually"" Per 100,000", s(small)) ///
ysc(titlegap(3)) ///
legend(lab(1 "UNODC Figures")) ///
note("Homicide and Democracy averages taken from 2000 to 2014.")
graph export HomicidesOverLD.png, replace
The graph looks like this:
Array


Above each of the bins, I would like to display the number of countries included in the "ldlvl" that I am creating the bars over. So, for example, there are 10 countries in group 4, so I would like the number 10 to appear on top of bar #4. I found an option called blabel that creates labels for the bars, but it is somewhat limited in what it will accept as a label and I haven't found a way to make it display the number of entries/countries included in each level 0-9. Any help would be much appreciated!

Best,

Julian

quick edit: I am producing a few dozen graphs similar to this where I would like to do the same thing, so I don't want to use the graph editor, doing each graph one by one.

Viewing all articles
Browse latest Browse all 65052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>