Statalist


[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" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
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
unnecessary). 

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. 

Nick 
n.j.cox@durham.ac.uk 

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
rconroy@rcsi.ie
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
http://www.flickr.com/photos/ronanconroy/sets/72157601895416740/

*
*   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/

*
*   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/



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