Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: stata graphs, x-axis formatting


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: stata graphs, x-axis formatting
Date   Wed, 19 May 2004 23:15:55 +0100

hemm0061
 
> (1) I have a histogram with numerical values (representing 
> week numbers)
> and I would like to convert them to the dates that they correspond to.
> Example: 33, 34, 35, 36 (these are the tick marks)
> I want to change them to "Aug 11" "Aug 18" "Aug 25" "Sept 1" 
> 
> I tried creating a label value without success.  Any suggestions?

Assuming that your variable is the number of weeks since the beginning
of 1960, which is what Stata tends to assume (see -help tdates-), then 

... , xla(... , format("%twm_d"))

where any ... is to be filled in by yourself. 

If 33, 34, 35, 36 are weeks of some unspecified year, known 
only to yourself, then there
are various solutions. The quickest if this is a one-off graph 
may be to do it on the fly 

... , xla(33 "Aug 11" 34 "Aug 18" ...) 

> (2) On a stacked bar graph the label value worked, but they 
> overlap.  Is
> there anyway to use the angle(verical) option?

graph bar ... , over(whatever, lab(ang(v))) 

_or_ consider what is often a much better solution
to avoid giraffe graphics: 

graph hbar ... , over(whatever) 

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