[R] adding infrequent date labels to x-axis

Peter Ehlers ehlers at ucalgary.ca
Tue Feb 23 22:47:42 CET 2010


On 2010-02-23 12:58, emorway wrote:
>
> Hi Hrishi,
>
> With regard to the post you helped me out with, I've got my graph almost
> dialed in the way I would like it.  There was one more small thing my
> searches have been unable to turn up.  I've tried searching with "stagger
> labels" "offset Labels" "alternate labels" to no avail.
>
> the pertinent lines of code I'm basing my question on are:
> m2<-ticks.lab=="Feb"|ticks.lab=="May"|ticks.lab=="Aug"|ticks.lab=="Nov"
> Axis(x,at=ticks.at[m2],side=1,labels=ticks.lab[m2],las=1,cex.axis=0.75,tick=F,padj=-2)
>
> I would prefer to use cex.axis=1, but because the labels crowd each other it
> doesn't place them all.  Is there a command I can use that would essentially
> stagger the labels?, like so...
>     |
>     |
>     |   (Graph Area)
>     +______________________________________
>      May      Nov      May     Nov
>            Aug      Feb      Aug     Feb
>
> http://n4.nabble.com/file/n1566433/TimeSeries_Example1.jpg
>

The plotrix package has staxlab().

  -Peter Ehlers


> Respectfully,
> Eric

-- 
Peter Ehlers
University of Calgary



More information about the R-help mailing list