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

Re: st: Remove day (but keep month and year) from x-axis


From   "Eric G. Wruck" <[email protected]>
To   [email protected]
Subject   Re: st: Remove day (but keep month and year) from x-axis
Date   Tue, 31 May 2005 20:47:45 -0400

Hi MA_V:

This will work

twoway tsline high, tlabel(, format(%dm-CY))

However, I suggest you try <help format> or consult the Stata manuals for further info on formats.

Best wishes,

Eric


p.s.  By the way, what is your actual name?


>Thanks. That was a great help. One more question: what if I just want the first three letters for each month and the last two numbers for the year? (e.g. Jan94)
>Thanks,
>MA_V
>
>>From: [email protected] (Derek Wagner, StataCorp)
>>Reply-To: [email protected]
>>To: [email protected]
>>Subject: Re: st: Remove day (but keep month and year) from x-axis
>>Date: Tue, 31 May 2005 16:30:06 -0500
>>
>>Ma_V wrote:
>>
>>> I have a time series plot that I constructed using the "twoway" function.
>>> My question is the following: I have daily data, but I just want month and
>>> year (and not day) to show up in the x-axis.
>>> Does anyone know how to do this?
>>
>>If you're not doing so already, you might want to use -twoway tsline- to
>>graph your time-series data.  Then, you can use the -format- suboption
>>within the -tlabel- option to format the labels on the time axis (x-axis).
>>For example:
>>
>>        . webuse sp500
>>
>>        . tsset date
>>
>>        . twoway tsline high, tlabel(, format(%dM/CY))
>>
>>This will give you labels with month and year instead of day/month/year.
>>
>>The -format- option will also work with labels in other -twoway- commands
>>if you don't want to use -twoway tsline-:
>>
>>        . twoway scatter high date, xlabel(, format(%dM/CY))
>>
>>Derek Wagner
>>
>>*
>>*   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/
>
>_________________________________________________________________
>Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>*
>*   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/


-- 

===================================================

       Eric G. Wruck
       Econalytics
       2535 Sherwood Road
       Columbus, OH  43209

       ph:      614.231.5034
       cell:    614.330.8846
       eFax:    614.573.6639
       eMail:   [email protected]
       website: http://www.econalytics.com

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