1

About the command 'scatterPlot' from package 'openair' of R, I used the following command:

data(mydata)

scatterPlot(mydata, x = "nox", y = "no2", method = "hexbin",
            colorcut = seq(0, 1, length = 7), cols =  "default", trans=log, inv=exp)

and I got this graphic:

Please Click Here To See The Graphic

I need to know if it is possible to have two Scatterplots on the same graph, one with the method "hexbin" and other with the method "scatter"?

Or, more specifically, it is possible to plot points of another variable over a scatterplot hexbin? I tried to do this for a while, but I did not get hit.

I appreciate any help.

4

1 回答 1

3

我在这里要说的是 Carslaw 教授(“openair”包的作者,它有“scatterPlot”命令)用以下对我有用的解决方案回复了我的电子邮件:

library(latticeExtra)
plt <- scatterPlot(mydata, method = "hexbin", col = "jet")
b <- scatterPlot(head(mydata, 200), col = "black", pch = 16, cex = 0.5)
plt$plot + as.layer(b$plot)
于 2016-01-25T23:16:28.267 回答