[R] reversing data axis in stripchart not working?
David Carlson
dcarlson at tamu.edu
Mon Feb 10 16:53:40 CET 2014
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))
--
--------------------------------------------------
Dr. Hermann Schier
Max-Planck-Institut fuer Festkoerperforschung
Informationsvermittlung der CPT-Sektion
Heisenbergstr. 1, D-70569 Stuttgart
Tel. ++-(0)711-689-1284 FAX ++-(0)711-689-1292
e-mail: h.schier at fkf.mpg.de
More information about the R-help
mailing list