[Matplotlib-users] plt.hexbin underlying algorithm

empet emilia.petrisor at gmail.com
Wed Mar 30 10:41:31 EDT 2016


Hi all,

Recently I experimented how plt.hexbin works.
I read a little bit about the  history of this method of binning, and I'm
curious how it was implemented in matplotlib. 
Could someone, please, point out where in /site-packages/matplotlib  is
implemented  the construction of the prototypical hexagon returned by:

    plt.hexbin(x, y, gridsize=25, cmap=my_cmap, mincnt=1).get_paths()

as well as  the computation of the PolyCollection offsets?

I ran my code in a Jupyter notebook and noticed that if I don't set
%matplotlib inline, then the 
PolyCollection instance

    HB=plt.hexbin(x, y, gridsize=25, cmap=my_cmap, mincnt=1)

has  only one facecolor initialized, i.e. len(Hb.get_facecolors())=1, while
len(HB.get_offsets())=300.
Is there a posibility to generate the facecolors without effective plotting
of the hexbin object?

Thanks,

Em



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/plt-hexbin-underlying-algorithm-tp46927.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


More information about the Matplotlib-users mailing list