#100_High_Density_scatter_plot_with_binning

 

 

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 !

[mediatagger]


Leave a Reply

2 Comments on "#100 High density scatterplot with binning"

avatar
  Subscribe  
newest oldest most voted
Notify of
Jonathan Bouchet
Guest

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’)))