Scatterplots can get very hard to interpret when displaying large datasets, as points inevitably overplot and can’t be individually discerned.

Binning can be though of as a two-dimensional histogram, where shades of the bins take the place of the heights of the bars. This technique is computed in the hexbin package.

This example has been published by Myles Harrison on R-bloggers.

Not what you are looking for ? Make a new search !


Leave a Reply

1 Comment threads
1 Thread replies
Most reacted comment
Hottest comment thread
2 Comment authors
HoltzJonathan Bouchet Recent comment authors
newest oldest most voted
Notify of
Jonathan Bouchet

Really nice, thanks !
I was looking if we could do the same with ggplot and I end up with the following :

mydata = data.frame(x,y)
ggplot(data=mydata,aes(x=x,y=y)) + stat_binhex(bins=40) + scale_fill_gradientn(colours=rev(brewer.pal(11,’Spectral’)))