Re: [R] stripchart with pch %in% 21:25 with bg

2009-09-24 Thread Jean lobry

stripchart.formula() works for me with your modification to
stripchart.default().


Great!


But you don't need the 'bordered' pch for that.


Indeed, but this may improve lisibility:

#
n - 500
x - rnorm(n)
y - rnorm(n)
fac1 - rep(c(male, female), n)
fac2 - rep(c(blue, red), each = n/2)
par(mfrow = c(1,2), lend = butt, mar = c(5,4,1,1), oma = c(0,0,4,0))
plot(x, y, pch = ifelse(fac1 == male, 15, 19), col = fac2, asp = 1)
mbg - rgb(0.9, 0.9, 0.9, 0.9)
legend(topleft, inset = 0.02, c(male,female), pch = c(15,19), bg = mbg)
legend(bottomright, inset = 0.02, c(blue,red), col = c(blue,red),
  bg = mbg, lty = 1, lwd = 5)
plot(x, y, pch = ifelse(fac1 == male, 22, 21), bg = fac2, asp = 1)
legend(topleft, inset = 0.02, c(male,female), pch = c(22, 21), bg = mbg)
legend(bottomright, inset = 0.02, c(blue,red), col = c(blue,red),
  bg = mbg, lty = 1, lwd = 5)
mtext(Comparison of pch c(15, 19) versus c(22, 21), outer = TRUE,
  cex = 1.5, line = 1)
##

Best,

Jean
--
Jean R. Lobry(lo...@biomserv.univ-lyon1.fr)
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I,
43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE
allo  : +33 472 43 27 56 fax: +33 472 43 13 88
http://pbil.univ-lyon1.fr/members/lobry/

__
R-help@r-project.org 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.


Re: [R] stripchart with pch %in% 21:25 with bg

2009-09-23 Thread Peter Ehlers

I think that it's a good idea, although I have rarely made use
of pch  20.

This reminds me to pass on a very belated thank-you to the
developer(s) who implemented the formula version for stripchart,
which I had promised to do myself quite a long time ago.
Thanks, folks!

Peter Ehlers

Jean lobry wrote:

Dear all,

consider:

###
x - round(rnorm(50))
stripchart(x,  pch = 21, col = black, bg = pink, method = jitter)
points(0.5, 1, pch = 21, col = black, bg = pink, cex = 2)
###

Under R 2.9.0 the points produced by stripchart are not colored,
while points() gives the desidered output (magnified here by cex).
I found a simple workaround by redefining the function
graphics:::stripchart.default() so that the dot-dot-dot (...)
argument is forwarded the the function points().

I have also tried to source the code for striptchart.R in
https://svn.r-project.org/R/trunk/src/library/graphics/R/stripchart.R
with revision number 49800, but the output is unchanged.

Am I missing something here? Is there no simpler way to achieve
this goal? I have search the NEWS for stripchart and found only
an entry for R 2.7.2 stating that:

ostripchart() now passes '...' to title() (as well as to
plot.default() and axis()). (Wish of PR#12202)

I may send a wish to R-dev, but I would like to make sure before that I
havn't miss something obvious.

Best,

Jean


__
R-help@r-project.org 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.


Re: [R] stripchart with pch %in% 21:25 with bg

2009-09-23 Thread Jean lobry

I think that it's a good idea, although I have rarely made use
of pch  20.

This reminds me to pass on a very belated thank-you to the
developer(s) who implemented the formula version for stripchart,
which I had promised to do myself quite a long time ago.
Thanks, folks!

Peter Ehlers


Hi Peter,

this is a good point by the way: my workaround is a shameless hack that
does not handle the case of the graphics:::stripchart.formula(),
while for sure it should. I hope that more competent people are
going to have a look at this.

The pch %in% 21:25 are very helpfull in some situations such as
in a 2X2 contingency table : circles for women, squares for males,
statisticians in blue, politicians in red (change for your favorite
dichotomous credo here).

Best,

Jean
--
Jean R. Lobry(lo...@biomserv.univ-lyon1.fr)
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I,
43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE
allo  : +33 472 43 27 56 fax: +33 472 43 13 88
http://pbil.univ-lyon1.fr/members/lobry/

__
R-help@r-project.org 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.


Re: [R] stripchart with pch %in% 21:25 with bg

2009-09-23 Thread Peter Ehlers

Jean lobry wrote:

I think that it's a good idea, although I have rarely made use
of pch  20.

This reminds me to pass on a very belated thank-you to the
developer(s) who implemented the formula version for stripchart,
which I had promised to do myself quite a long time ago.
Thanks, folks!

Peter Ehlers


Hi Peter,

this is a good point by the way: my workaround is a shameless hack that
does not handle the case of the graphics:::stripchart.formula(),
while for sure it should. I hope that more competent people are
going to have a look at this.


stripchart.formula() works for me with your modification to
stripchart.default().



The pch %in% 21:25 are very helpfull in some situations such as
in a 2X2 contingency table : circles for women, squares for males,
statisticians in blue, politicians in red (change for your favorite
dichotomous credo here).


But you don't need the 'bordered' pch for that.

Peter



Best,

Jean


__
R-help@r-project.org 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.