Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

revaxis

Plot with axis direction(s) reversed


Description

Reverses the sense of either or both the x and y axes.

Usage

revaxis(x, y, xrev=FALSE, yrev=TRUE, xside=if (yrev) 3 else 1,
       yside=if (xrev) 4 else 2, xlab=NULL, ylab=NULL, bty=NULL, ...)

Arguments

x

Vector of x-coordinates of the data to be plotted.

y

Vector of y-coordinates of the data to be plotted.

xrev

Logical scalar; should the sense of the x-axis be reversed?

yrev

Logical scalar; should the sense of the y-axis be reversed?

xside

The side of the plot on which the x-axis labels should go.

yside

The side of the plot on which the y-axis labels should go.

xlab

Character string for labelling the x-axis.

ylab

Character string for labelling the y-axis.

bty

Single letter indicating the type of box to be drawn around the plot. See par for the possible letters and their meaning.

...

Other arguments to be passed to plot.

Value

nil

Author(s)

Rolf Turner

See Also

Examples

x <- runif(20)
y <- runif(20)
revaxis(x,y,yside=4)

plotrix

Various Plotting Functions

v3.8-1
GPL (>= 2)
Authors
Jim Lemon, Ben Bolker, Sander Oom, Eduardo Klein, Barry Rowlingson, Hadley Wickham, Anupam Tyagi, Olivier Eterradossi, Gabor Grothendieck, Michael Toews, John Kane, Rolf Turner, Carl Witthoft, Julian Stander, Thomas Petzoldt, Remko Duursma, Elisa Biancotto, Ofir Levy, Christophe Dutang, Peter Solymos, Robby Engelmann, Michael Hecker, Felix Steinbeck, Hans Borchers, Henrik Singmann, Ted Toal, Derek Ogle, Darshan Baral, Ulrike Groemping, Bill Venables
Initial release
2021-01-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.