@@ -7941,15 +7941,13 @@ def hist2d(self, x, y, bins = 10, range=None, weights=None, cmin=None, cmax=None
7941
7941
Make a 2d histogram plot of *x* versus *y*, where *x*,
7942
7942
*y* are 1-D sequences of the same length
7943
7943
7944
- The return value is (counts,xedges,yedges,im )
7944
+ The return value is (counts,xedges,yedges,PolyCollection )
7945
7945
7946
7946
Optional keyword arguments:
7947
7947
*bins*: [None | int | [int, int] | array_like | [array, array]]
7948
7948
The bin specification:
7949
7949
If int, the number of bins for the two dimensions (nx=ny=bins).
7950
7950
If [int, int], the number of bins in each dimension (nx, ny = bins).
7951
- If array_like, the bin edges for the two dimensions (x_edges=y_edges=bins).
7952
- If [array, array], the bin edges in each dimension (x_edges, y_edges = bins).
7953
7951
The default value is 10.
7954
7952
7955
7953
*range*: [*None* | array_like shape(2,2)]
@@ -7980,14 +7978,12 @@ def hist2d(self, x, y, bins = 10, range=None, weights=None, cmin=None, cmax=None
7980
7978
range = __builtins__ ["range" ]
7981
7979
h ,xedges ,yedges = np .histogram2d (x , y , bins = bins , range = bin_range , normed = False , weights = weights )
7982
7980
7983
- if 'origin' not in kwargs : kwargs ['origin' ]= 'lower'
7984
- if 'extent' not in kwargs : kwargs ['extent' ]= [xedges [0 ], xedges [- 1 ], yedges [0 ], yedges [- 1 ]]
7985
- if 'interpolation' not in kwargs : kwargs ['interpolation' ]= 'nearest'
7986
- if 'aspect' not in kwargs : kwargs ['aspect' ]= 'auto'
7987
7981
if cmin is not None : h [h < cmin ]= None
7988
7982
if cmax is not None : h [h > cmax ]= None
7989
7983
7990
- im = self .imshow (h .T ,** kwargs )
7984
+ im = self .pcolorfast (xedges ,yedges ,h .T ,** kwargs )
7985
+ self .set_xlim (xedges [0 ],xedges [- 1 ])
7986
+ self .set_ylim (yedges [0 ],yedges [- 1 ])
7991
7987
7992
7988
return h ,xedges ,yedges ,im
7993
7989
0 commit comments