RE: st: blabel(group) for bar graphs

If -graph bar- doesn't show the flexibility you want
one option is to knit your own with -twoway bar-.
Here is a long way round:
collapse (mean) headroom trunk, by(foreign)
gen foreign1 = foreign - 0.1
gen foreign2 = foreign + 0.1
gen max = max(headroom, trunk)
twoway bar headroom foreign1 , barwidth(0.2)
|| bar trunk foreign2 , barwidth(0.2)
|| scatter max foreign , ms(none) mlabel(foreign) mlabpos(12) xla(none)
Nick
n.j.cox@durham.ac.uk
Håkon Finne
> Thanks for the suggestion, Phil; but no; I actually want the
> group name and not the variable name (because I later want to
> remove the label on the category axis due to space
> considerations). The problem is that the group label is
> incorrect once there is more than one yvar.
Philip Ryan
> By specifying -blabel(group)- you have asked Stata to label
> the bars with
> the value labels of the first (and in your case, only)
> over() variable,
> that is, foreign.
>
> Specifying -blabel(name)- will get you closer to what I think
> you want.
>
> see help graph -- bar --blabel_options
Håkon Finne
> the admittedly nonsensical example below,
>
> sysuse auto, clear
> graph bar headroom trunk, over(foreign) blabel(group)
>
> will produce bar labels inconsistent with labels on the
> category axis.
> What have I done to make all cars domestic?
>
> One should also think it possible to reproduce this behavior with
>
> graph hbar headroom trunk, over(foreign) blabel(group)
>
> and yet another surprise -- have I suddenly moved abroad?
>
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/