Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Montly data - remove month from x-axis and keep year only


From   "Kathrin Jacobs" <[email protected]>
To   [email protected]
Subject   st: Montly data - remove month from x-axis and keep year only
Date   Mon, 10 Feb 2014 12:36:16 +0100 (CET)

Dear Statalisters,
 
I have a time series plot that I constructed using the "twoway" function. My question is the following: I have monthly data, but I just want the year to show up in the x-axis.
My time variable is formatted as %tmMon_CCYY.
 
My x-axis currently looks like this: January 2000, January 2001, ..., January 2014 with minor ticks for the months
I would like to have it labelled as 2000 2001,...,2014 centered over the minor ticks:
 
|,,,,,,,,,,,|,,,,,,,,,,,|,,,,,,,,,,,|
    2000         2001        2002
 
I have tried various options, but if I add the %ty format, I have strange values (0480   0500   0520 ...)  instead of years on the axis
tsline consumption xlabel(,format(%ty)) tmtick(##12)
Does anyone know how to do this?
I'd greatly appreciate your help
 
Thank you,
Kathrin Jacobs

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index