From: per freem <perfreem@gm...>  20090805 14:48:52
Attachments:
Message as HTML

hi all, is there a way to make density plots using hexagonal bins in matplotlib? what i mean is something like the hexbin package for R, where you can make density plots where hexagons are plotted in size proportion to the number of points in that hexagonal bin... see http://www.bioconductor.org/packages/2.3/bioc/html/hexbin.html alternatively, the hexgons can be of the same size but shaded in proportion to their counts. i am more interested in the case where the hexagons are sized differently, but in any case, both hexagonal density plots come with an associated legend on the side that shows the bins: http://bm2.genes.nig.ac.jp/RGM2/R_current/library/hexbin/man/gplot.hexbin.html is there a way to do this in matplotlib? thanks for your help. 
From: Ryan May <rmay31@gm...>  20090805 15:25:43
Attachments:
Message as HTML

On Wed, Aug 5, 2009 at 9:48 AM, per freem <perfreem@...> wrote: > hi all, > > is there a way to make density plots using hexagonal bins in matplotlib? > what i mean is something like the hexbin package for R, where you can make > density plots where hexagons are plotted in size proportion to the number of > points in that hexagonal bin... see > http://www.bioconductor.org/packages/2.3/bioc/html/hexbin.html > > alternatively, the hexgons can be of the same size but shaded in proportion > to their counts. i am more interested in the case where the hexagons are > sized differently, but in any case, both hexagonal density plots come with > an associated legend on the side that shows the bins: > > > http://bm2.genes.nig.ac.jp/RGM2/R_current/library/hexbin/man/gplot.hexbin.html > > is there a way to do this in matplotlib? thanks for your help. > Not to be rude, but is there any reason you didn't look for pyplot.hexbin before sending the email? :) Ryan  Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma 
From: John Hunter <jdh2358@gm...>  20090805 16:36:42

On Wed, Aug 5, 2009 at 10:25 AM, Ryan May<rmay31@...> wrote: >> is there a way to do this in matplotlib? thanks for your help. > > Not to be rude, but is there any reason you didn't look for pyplot.hexbin > before sending the email? :) Continuing in the nonrude vein :) See these examples:: http://matplotlib.sourceforge.net/examples/pylab_examples/hexbin_demo.html http://matplotlib.sourceforge.net/examples/pylab_examples/hexbin_demo2.html and this doc string:: http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.hexbin Have fun! JDH 
From: per freem <perfreem@gm...>  20090813 01:46:06

hi all, thank you for your replies. my original message wasn't detailed enough. what i am looking for is a hexbin plot, where points are binned into hexagons and then hexagons are plotted in size proportional to the points in the bin. i think the links provided are very relevant for this, but one thing i cannot information on is: how can i make an automatic legend for such plots, where hex bins of varying sizes are shown to tell the viewer how many points fall into each bin size? to make this clear, i am looking for something like this: http://rspatial.sourceforge.net/gallery/fig/fig12.png where instead of bubbles, we have hexbins, and the legend on the right gives a mapping from differently sized hex bins to the number of points in that hexbin. any help on this would be greatly appreciated. thanks. On Wed, Aug 5, 2009 at 12:36 PM, John Hunter<jdh2358@...> wrote: > On Wed, Aug 5, 2009 at 10:25 AM, Ryan May<rmay31@...> wrote: > >>> is there a way to do this in matplotlib? thanks for your help. >> >> Not to be rude, but is there any reason you didn't look for pyplot.hexbin >> before sending the email? :) > > Continuing in the nonrude vein :) See these examples:: > > http://matplotlib.sourceforge.net/examples/pylab_examples/hexbin_demo.html > http://matplotlib.sourceforge.net/examples/pylab_examples/hexbin_demo2.html > > and this doc string:: > > http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.hexbin > > Have fun! > JDH > 