Skip to content
Prev 336449 / 398502 Next

reversing data axis in stripchart not working?

You are correct, but I do not know why stripplot works
differently from plot. I can give you two ways to get around the
problem though. The easiest is to use the plot command to
emulate stripchart:

plot(x, rep(1, length(x)), xlim=c(2, -2), yaxt="n", ylab="",
pch=0)

Or using stripchart:

stripchart(-x, xaxt="n", xlim=c(-2, 2))
vals <- seq(2, -2, by= -1)
axis(1, -vals, vals)

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: r-help-bounces at r-project.org
[mailto:r-help-bounces at r-project.org] On Behalf Of Hermann
Schier
Sent: Monday, February 10, 2014 7:15 AM
To: r-help at r-project.org
Subject: [R] reversing data axis in stripchart not working?

Hi,

I tried to reverse the data axis in stripchart
which should work according to docu with
xlim = c(Hi, Lo)
but it did not work.
Same effect in DotPlot from lessR.

Any there work arounds or hints?

Thanks

Hermann

example:
x <- stats::rnorm(50)
stripchart(x)
# setting limits works
stripchart(x, xlim = c(-2, 2))
# reversing data axis does not work
stripchart(x, xlim = c(2,-2))