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


2
Leave a Reply

avatar
1 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
HoltzJonathan Bouchet Recent comment authors
  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’)))