@@ -2874,27 +2874,25 @@ def scatter(self, x, y, s=None, c=None, **kwds):
2874
2874
def hexbin (self , x , y , C = None , reduce_C_function = None , gridsize = None ,
2875
2875
** kwds ):
2876
2876
"""
2877
- Make hexagonal binning plots .
2877
+ Make hexagonal binning plot .
2878
2878
2879
- Make an hexagonal binning plot of `x` versus `y`, where `x`,
2880
- `y` are 1-D sequences of the same length, `N`. If `C` is `None`
2879
+ Make an hexagonal binning plot of `x` versus `y`. If `C` is `None`
2881
2880
(the default), this is an histogram of the number of occurrences
2882
2881
of the observations at (x[i],y[i]).
2883
2882
2884
2883
If `C` is specified, specifies values at given coordinates
2885
2884
(x[i],y[i]). These values are accumulated for each hexagonal
2886
2885
bin and then reduced according to `reduce_C_function`,
2887
- having as default
2888
- the numpy's mean function (np.mean). (If *C* is
2889
- specified, it must also be a 1-D sequence of the same length
2890
- as `x` and `y`.)
2886
+ having as default the numpy's mean function (np.mean).
2887
+ (If `C` is specified, it must also be a 1-D sequence
2888
+ of the same length as `x` and `y`.)
2891
2889
2892
2890
Parameters
2893
2891
----------
2894
- x : label or position, optional
2895
- Coordinates for x point .
2896
- y : label or position, optional
2897
- Coordinates for y point .
2892
+ x : label or position
2893
+ Coordinates for x points .
2894
+ y : label or position
2895
+ Coordinates for y points .
2898
2896
C : label or position, optional
2899
2897
The value at each `(x, y)` point.
2900
2898
reduce_C_function : callable, optional, default `mean`
@@ -2905,31 +2903,30 @@ def hexbin(self, x, y, C=None, reduce_C_function=None, gridsize=None,
2905
2903
The corresponding number of hexagons in the y-direction is
2906
2904
chosen in a way that the hexagons are approximately regular.
2907
2905
Alternatively,
2908
- gridsize can be a tuple with two elements specifying the number of
2909
- hexagons in the x-direction and the y-direction.
2906
+ gridsize can be a tuple with two elements specifying the number
2907
+ of hexagons in the x-direction and the y-direction.
2910
2908
kwds : optional
2911
2909
Keyword arguments to pass on to :py:meth:`pandas.DataFrame.plot`.
2912
2910
2913
2911
Returns
2914
2912
-------
2915
- axes : matplotlib.AxesSubplot or np.array of them .
2913
+ axes : matplotlib.AxesSubplot.
2916
2914
2917
2915
See Also
2918
2916
--------
2919
- matplotlib.pyplot.hexbin : hexagonal binning plot using matplotlib.
2917
+ matplotlib.pyplot.hexbin : hexagonal binning plot using matplotlib,
2918
+ the matplotlib function that is used under the hood.
2920
2919
2921
2920
Examples
2922
2921
--------
2923
2922
2924
2923
.. plot::
2925
2924
:context: close-figs
2926
2925
2927
- >>> from sklearn.datasets import load_iris
2928
- >>> iris = load_iris()
2929
- >>> df = pd.DataFrame(iris.data, columns=iris.feature_names)
2930
- >>> hexbin = df.plot.hexbin(x='sepal length (cm)',
2931
- ... y='sepal width (cm)',
2932
- ... gridsize=10, cmap='viridis')
2926
+ >>> n = 100000
2927
+ >>> df = pd.DataFrame({'x':np.random.randn(n),
2928
+ ... 'y':np.random.randn(n)})
2929
+ >>> hexbin = df.plot.hexbin(x='x', y='y', cmap='viridis')
2933
2930
"""
2934
2931
if reduce_C_function is not None :
2935
2932
kwds ['reduce_C_function' ] = reduce_C_function
0 commit comments