Skip to content

Split plot in colors/pch??

2 messages · Warnes, Gregory R, Paul Murrell

#
Actually Jeorg's answer works just fine for this case, with one small change

	# create the data frame (g is gender)
	d <- data.frame(x=c(1,2,3,4,5,6,4,3),y=1:8,
                      g=c('M','F','M','F','F','M','F','F')) 

	# plot using specified colors
	co <- c('red','blue')
	plot(d$x,d$y,col=co[d$g])

	# plot using default colors
	plot(d$x,d$y,col=codes(d$g))

-Greg
LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
2 days later
#
Hi

You might also want to look at using xyplot() and panel.superpose from the
lattice package.  For example, ...

    library(lattice)
    data(iris)
    attach(iris)
    xyplot(Sepal.Length ~ Sepal.Width, groups=Species,
panel=panel.superpose)

Paul
change
privileged. It is intended for the addressee(s) only. Access to this E-mail
by anyone else is unauthorized. If you are not an addressee, any disclosure
or copying of the contents of this E-mail or any action taken (or not taken)
 in reliance on it is unauthorized and may be unlawful. If you are not an
addressee, please inform the sender immediately.
-.-.-
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._