[R] How to reverse the sequence of axis Y ??

Kristel Joossens kristel.joossens at econ.kuleuven.be
Sat Dec 17 18:04:13 CET 2005


Hello Klebyn,

It might be that a better solution exists, but here is something that 
might help you. (I used that all y's are positive!)

R> maxy=ceiling(max(y))
R> plot(x,maxy-y,axes=FALSE)
R> axis(1)
R> axis(2,0:maxy,seq(maxy,0,-1))

If not all your y's are positive define `miny' and take then
R> axis(2,miny:maxy,seq(maxy,miny,-1))

Best regards and good luck,
Kristel

klebyn wrote:
>  
> 
> Hello R-users!
> 
> My (simple?) doubt: How to reverse the sequence of axis Y ??
> 
> the diagram below illustrate my idea...
> 
> (default)
>    |
>    |
> .  |
> .  |
> .  |
> 3  |
> 2  |
> 1  |
> 0  +----------------------------
>    0 1 2 3 ...
> 
> 
> 
> like I want...
>  
> 0  |
> 1  |
> 2  |
> 3  |
> .  |
> .  |
> .  |
>    |
>    +----------------------------
>    0 1 2 3 ...
> 
> 
> thanks in advance
> 
> 
> klebyn
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


-- 
__________________________________________
Kristel Joossens        Ph.D. Student
Research Center ORSTAT  K.U. Leuven
Naamsestraat 69         Tel: +32 16 326929
3000 Leuven, Belgium    Fax: +32 16 326732
E-mail:  Kristel.Joossens at econ.kuleuven.be
http://www.econ.kuleuven.be/public/ndbae49

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm




More information about the R-help mailing list