Every other month is either a set of
odd numbers or a set of even numbers,
depending on the start point.
For example,
levels month if mod(month,2) == 0, local(show)
picks up the even months, which will
be Jan Mar May Jul Sept Nov, given
Stata's origin 0 = Jan 1960.
So you can go
... xla(`show', ang(v) labsize(vsmall))
Every third month can be done with a similar
trick.
Even more direct is just to use a numlist
... xla(251(3)349, ang(v) labsize(small))
but that requires either working it out
by hand or something else previously.
It could in turn be automated.
Ulrich Kohler wrote an -egen- function
as a helper for the second problem.
. ssc desc gmlabvpos
Nick
[email protected]
Eric G. Wruck
> I basically I have a graph I like of stock return indices over time.
> However, my efforts to tweak the graph a bit have been unsuccessful
> Specifically,
>
> (1) The x-axis is a month-year variable (%dm-Y). I am using
> xlabel(#48 , angle(vertical) labsize(vsmall)) to get every month on
> the x-axis. I'd like to specify a rule such as every other month or
> every third month. Is there any easy way to do this for a variable
> that is a date?
>
> (2) I also have a string variable called news that I am using as a
> marker label for one of the stock indices. The problem is that
> sometimes the text is obscured by the graphed lines. Sometimes, I
> would want the text to appear at 6 o'clock, other times midnight,
> etc. I thought I could do this by inspection & create multiple news
> variables that I could use as multiple labels -- one variable might
> be for news events that I want to appear at 6 o'clock, another news
> variable for events that I want to appear at midnight, etc. First of
> all, I don't know whether this can be done -- can it? And secondly,
> it seems rather primitive. Is there an easier way, one not requiring
> this sort of intervention?
>
> Thanks very much.
>
> Eric
>
> --
>
> ===================================================
>
> Eric G. Wruck
> Econalytics
> 2535 Sherwood Road
> Columbus, OH 43209
>
> ph: 614.231.5034
> cell: 614.327.4182
> fax: 614.231.5039
> 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/
>
*
* 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/