Statalist The Stata Listserver


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

Re: st: time series graph xlab/tlab


From   Caleb Southworth <[email protected]>
To   [email protected]
Subject   Re: st: time series graph xlab/tlab
Date   Sat, 11 Feb 2006 12:54:02 -0800 (PST)

On Sat, 11 Feb 2006, Austin Nichols wrote:

:Ignoring the rest of the problem, look at what a nice informative
:error message you got--why are you specifying the dates in the
:tlabel() option as strings, rather than numbers?  You can get the
:corresponding numbers easily enough:
:. di mdy(9,1,1992)

Sure. That's a work around, but the whole point of tlab is to be able to
use real values. From the man for axis_label_options:

tlabel(), tmlabel(), ttick(), and tmtick() also accept a datelist and
        an extra type of rule

So as a kludge:

format date %5.0f
list date

. list date

     +-------+
     |  date |
     |-------|
  1. | 11932 |
  2. | 12085 |
  3. | 12235 |
  4. | 12358 |
  5. | 12753 |
     |-------|
  6. | 13057 |
  7. | 13423 |
  8. | 14184 |
  9. | 14884 |
 10. | 15249 |
     |-------|
 11. | 15614 |
 12. | 15979 |
     +-------+

lab def q 11932 "1992Q2" 12085 "1993Q1" 12235 "1993Q2" 12358 "1993Q4"
12753 "1994Q4" 13057 "1995Q4" 13423 "1996Q4" ///
	14184 "1998Q4" 14884 "2000Q4" 15249 "2001Q4" ///
	15614 "2002Q4" 15979 "2003Q4"
lab val date q

then use the values option when labeling.

Inelegant springs to mind ;-) And the error message doesn't explain why
the faq says you can enter %d formatted values but command seems to want
numbers.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index