lattice overlay

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

lattice overlay

Ram H. Sharma
Dear experts:

I want to overlay lattice scatter plot: I do not know why the following code
is not plotting subscripts ! Sorry if this question is too simple:

require(lattice)

xyplot(Sepal.Length ~ Sepal.Width | Species , data= iris,

  panel= function(x, y, subscripts) {

panel.xyplot(x, y, pch=16, col = "green4", ylim = c(0, 10))

panel.lmline(x, y, lty=4, col = "green4")

panel.xyplot (iris$Petal.Length [subscripts],
iris$Petal.Width[subscripts], pch= 3, col = "red")

panel.lmline(iris$Petal.Length [subscripts], iris$Petal.Width
[subscripts], col = "red")

}, as.table=T, subscripts=T)


Thank you;

--

Ram H

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: lattice overlay

Dieter Menne
Ram H. Sharma wrote
I want to overlay lattice scatter plot: I do not know why the following code
is not plotting subscripts ! Sorry if this question is too simple:

Working example shortened:

.....panel.xyplot(x, y, pch=16, col = "green4", ylim = c(0, 10))
Because they are out of range. Put ylim outside the panel, and it works.

Dieter