panel.hextri | R Documentation |
Displays a hexagonally-binned scatterplot with coloured subtriangles to indicate number of observations in each class. Uses the Sainte-Lague method to apportion counts to triangles, ensuring the counts round to exactly six triangles per hexagon.
panel.hextri(x, y, groups, subscripts, colours, nbins = 10, border = TRUE, diffuse = FALSE, style = c("alpha", "size"), weights = NULL, sorted=!diffuse, shape = 1, ...)
x,y |
point coordinates for the subset being plotted |
groups |
A factor giving the class identity for all points (will be filled in automatically by |
subscripts |
Vector selecting the elements of |
colours |
Vector of colors (number, name, or hashtag format) giving the colours for each class |
nbins |
Number of bins along the x axis |
border |
If |
diffuse |
If |
style |
Represent data by hexagon size or by alpha-blending |
weights |
If not |
sorted |
Sort the triangles into a consistent order within each hex? |
shape |
Aspect ratio for each hex. |
... |
because you have to. |
A panel
Thomas Lumley
hextri
is the base-graphics plot
library(lattice) xx<-rnorm(1000) yy<-rnorm(1000) cc<-cut(xx*yy,c(-Inf,-.4,0,.4,Inf)) zz<-cut(xx+yy,c(-Inf,-1,0,1,Inf)) plot(xx,yy,col=(1:4)[cc]) xyplot(yy~xx|zz, panel=panel.hextri,groups=cc,colours=1:4,style="size",nbins=10) data(airquality) airquality$o3group<-with(airquality, cut(Ozone, c(0,18,60,Inf))) xyplot(Temp~Solar.R|equal.count(Wind,4), groups=o3group, panel=panel.hextri, data=na.omit(airquality),colours=c("royalblue","grey60","goldenrod"), strip=strip.custom(var.name="Wind Speed"),xlab="Solar Radiation (langley)", ylab="Temperature (F)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.