I'm creating bar graphs with similar code:
graph bar var1 var2 var3 var4, ///
over(race, relabel (1 "race1" 2 "race2" 3 "race3" 4 "race4" 5 "race5")) ///
stack ///
graphregion(color(white)) ///
title("Average Number of Things", color(black)) ///
subtitle("Subgroup", color(black)) ///
ytitle("# of Things") ///
ylabel(0(.5)2,nogrid) ///
legend(label (1 "Type 1") ///
label (2 "Type 2") ///
label (3 "Type 3") ///
label (4 "Type 4")) ///
bar(1, bcolor(navy)) ///
bar(2, bcolor(ebblue)) ///
bar(3, bcolor(eltblue)) ///
bar(4, bcolor(ebg)) ///
blabel(total, format(%4.1f))
var1+var2+var3+var4 = total of interest
I'd like each bar to be labeled with the total of var1+var2+var3+var4 but not any of the lesser cumulative totals. Is there any way to do this using graphing options that I can write into a .do file? I can delete all the lesser cumulative totals produced with the above code using the graphing editor, but I'd really like to be able to automate that.
Thank you!
Related Posts with bar graph / blabel()
reshape 4-levels wide format to 2X2 long formatHello, I have designed a 2✖2 within-subject design and get a 4-level repeated measure, how could I …
ARCH effect after fitting GARCH(1,1)I am trying to messure volatility of return on stock index by using GARCH(1,1) but the ARCH-LM test …
Help with Stochastic Frontier Analysis/Translog Cost Function in Stata 15, bc95 modelDear Stata users, I am using Stata 15 and I am quite new in using this software. I am working on a …
Help with collapse (sum) commandI have a dataset, which has a (country_name) variable and a count of (requests) sent from that count…
Local macro returns variable name and subscript rather than valueHi Statalist, I am trying to rename a set of variables in Stata 16.1. The new variable name I want …
Subscribe to:
Post Comments (Atom)
0 Response to bar graph / blabel()
Post a Comment