[R] Date label lost while inverting y axis.
David Winsemius
dwinsemius at comcast.net
Fri Feb 19 15:48:34 CET 2010
On Feb 19, 2010, at 2:20 AM, Jeremie Smaga wrote:
> Good morning,
>
> I am currently displaying a time series with the time on the Y axis,
> and the
> values on the X axis.
> The problem is that I wanted to reverse the Y axis (that is, to have
> the
> latest date the closest to the X axis).
> So I looked for a way to do this on this mailing list and I found a
> response: inverting the ylim parameter of the plot.
> I did it, the data are displayed correctly, but now the problem is
> that
> there is no more labels on the Y axis.
> How should I proceed to have it back?
>
>
> Here is my code:
>
> *******************************
> sMin=min(series[,2:3])
> sMax=max(series[,2:3])
> plot(series[,
> 2
> ],dates
> ,xlim
> =
> c
> (sMin
> ,sMax
> ),ylim
> =c(max(dates),min(dates)),col="green",main="",type="l",xlab="Value")
> *******************************
>
Offhand I would guess:
..., xlim = rev (range( series([, 2:3] ) ), ...
And I suppose you have your own reasons for not offering the data to
test possible solutions.
--
David.
> Thanks,
>
> --
> Jeremie
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
More information about the R-help
mailing list