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:
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.
ggplot2
. You could use bothgeom_hex
andgeom_point
. For example, using thediamonds
data set, you could do something like the followingd <- ggplot(diamonds, aes(carat, price))
andd + geom_hex() + geom_point(aes(carat, price), size = .15, colour = 'magenta', alpha=.15)
– steveb@steveb
. But you can tell me if there is, somehow, some way to make this usingscatterPlot
(byopenair
), or even usinghexbinplot
(byhexbin
)? – Dani Depiopenair
manual but didn't see anything that would help. If nobody answers your question on SO, you could contact them at openair-project.org/Contact.aspx – steveblibrary(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)
– Dani Depi