The graph created by the code below shows the total population of each region of the US. I am hoping to add a label to each bar displaying the percentage of the total, which I have calculcated using the code below. Is there an easy way to do this?
I know I could create a stacked bar chart showing this group as a proportion of the total, but I'm specifically interested in whether it's possible to add this information as labels.
Your advice and ideas would be greatly appreciated.
sysuse census, clear
collapse (sum) pop pop5_17, by(region)
generate pr_5_17 = round(pop5_17/pop, 0.01)*100
replace pop = pop/1000000
rename pop pop_millions
graph bar (asis) pop_millions, over(region) ytitle("Population (In Millions)")
Best,
Erika
I know I could create a stacked bar chart showing this group as a proportion of the total, but I'm specifically interested in whether it's possible to add this information as labels.
Your advice and ideas would be greatly appreciated.
sysuse census, clear
collapse (sum) pop pop5_17, by(region)
generate pr_5_17 = round(pop5_17/pop, 0.01)*100
replace pop = pop/1000000
rename pop pop_millions
graph bar (asis) pop_millions, over(region) ytitle("Population (In Millions)")
Best,
Erika
Comment