I seem to remember a previous thread pointing
to the absence of -mlabformat()-.
I tried generating a _string_ variable to use under
-addlabopts()- in -histogram-, but got nowhere.
However, this convoluted work-around may be
of interest.
bysort rep78 : gen count = _N
count if rep78 < .
gen density = count / r(N)
gen sdensity = string(density, "%4.3f")
twoway bar density rep78, bstyle(histogram) ||
scatter density rep78, ms(none) mlabel(sdensity) mlabpos(12)
OR
twoway histogram rep78, discrete ||
scatter density rep78, ms(none) mlabel(sdensity) mlabpos(12)
Thanks Nick, that is a 'relatively straightforward workaround' which worked
for me. Finally most solutions seem to come down on creating your own
labels in some kind of variable and than switch to the twoway-concept. On
the other hand, I don't see why in this particular case Stata did not
include some 'mlabformat', to cure irregular labeling...