How to insert a legend in grid.hexagons from hexbin in R -


how insert legend in example below?

library("grid") library("hexbin")  set.seed(506) x <- rnorm(10000) y <- rnorm(10000) z <- rnorm(100) w <- rnorm(100)  xmin = min(x, z) xmax = max(x, z)  ymin = min(y, w) ymax = max(y, w)  df <- data.frame(x, y) bin <- hexbin(df, xbins=30, xbnds= c(xmin, xmax) , ybnds= c(ymin, ymax)) graphic <- hboxplot(bin, xbnds= c(xmin, xmax) , ybnds= c(ymin, ymax))  pushhexport(graphic)   grid.hexagons(bin, border = gray(.7))   grid.points(z, w, pch=20, gp=gpar(col="blue")) #z , w others data vectors plot points on de grid.hexagons. upviewport() 

i tried grid.hexlegend not worked me, maybe did not done right.

i appreciate help.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -