# Reverse order of x-axis

6 messages
Open this post in threaded view
|
Report Content as Inappropriate

## Reverse order of x-axis

 Hello, does anybody know, how to reverse the elements of the x-axis. At now my x-axis for example goes from 0, 0.5, 1, 1.5, ... to 99.5, 100.0 Is there a way to change the x-axis, like this: 100.0, 99.5, 99.0, ..., 0.5, 0. The 100.0 should start at left x-axis and the 0 shold be on the right. Greeting
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Reverse order of x-axis

 This post has NOT been accepted by the mailing list yet. Hello, Try this: x<-c(1,4,7,9,10,15)  y<-c(3,5,8,6,5,14) x1<-x[rev(order(x))] plot(x1,y,xlim=rev(range(x))) A.K.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Reverse order of x-axis

 Thanks, for the moment it works. But is there a possibility for a logarithmic x-Axis? When i use log='x' i get only a vertical line. Greetings
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Reverse order of x-axis

 In reply to this post by sappy Hello, Just reverse the xlim values, it defaults to c(min, max), use c(max, min). x <- 1:10 plot(x) plot(x, xlim=c(10, 1)) Hope this helps, Rui Barradas Em 29-07-2012 18:23, sappy escreveu: > Hello, > > does anybody know, how to reverse the elements of the x-axis. At now my > x-axis for example goes from 0, 0.5, 1, 1.5, ... to 99.5, 100.0 > Is there a way to change the x-axis, like this: 100.0, 99.5, 99.0, ..., 0.5, > 0. The 100.0 should start at left x-axis and the 0 shold be on the right. > > Greeting > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Reverse-order-of-x-axis-tp4638275.html> Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > [hidden email] 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. ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Reverse order of x-axis

 In reply to this post by sappy (1) Please show context; r-help is *not* nabble. (2) You might like to investigate the revaxis() function from the "plotrix" package.      cheers,          Rolf Turner On 30/07/12 07:41, sappy wrote: > Thanks, > > for the moment it works. But is there a possibility for a logarithmic > x-Axis? When i use log='x' i get only a vertical line. > ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.