Share the Gallery !Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

 

#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 !


Leave a Reply

1 Comment on "#100 High density scatterplot with binning"

Notify of
avatar
Sort by:   newest | oldest | most voted
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’)))

wpDiscuz