[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Controlling display format for -addlabel- option on -histogram-

From   "Nick Cox" <>
To   <>
Subject   st: RE: Controlling display format for -addlabel- option on -histogram-
Date   Mon, 11 Feb 2008 12:01:01 -0000

I think you might need to go a long way round and use
-twoway__histogram_gen- followed by -string(,)- to create a 
string variable that you could use as marker labels. On the face of it,
a   -format()- option or suboption would seem natural in this context. 

On the general point, I quite often do something similar (although I
usually then also suppress a magnitude scale, which is then

With -tabplot- from SSC you can do this: 

. sysuse auto, clear 
. gen one = 1
. tabplot one rep78, showval(format(%9.2f) offset(0.02))  
	percent ytitle("") ysc(off)

-tabplot- won't let you put values at the top of bars, but the code
shows that the problem is programmable. 


Ronan Conroy

A colleague was producing some bar charts using -histogram-, using  
the -addlabel- option to add the actual values at the top of each  
bar. (I find this a futile exercise, but some folks like it.)

He found that his labels were being added with two or even three  
places of decimals. For the life of me I cannot find how to use the - 
histogram- graph dialogue to control the display format. Can it be done?

P    Before printing, think about the environment
Ronan Conroy
Royal College of Surgeons in Ireland
Epidemiology Department,
120 St Stephen's Green, Dublin 2, Ireland
+353 (0)1 402 2431
+353 (0)87 799 97 95

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index