@@ -799,7 +799,7 @@ def ohlc(self, x=None, y=None, **kwds):
799
799
"""
800
800
return self (kind = 'ohlc' , x = x , y = y , ** kwds )
801
801
802
- def heatmap (self , x = None , y = None , C = None , colorbar = True , ** kwds ):
802
+ def heatmap (self , x = None , y = None , C = None , colorbar = True , logz = False , ** kwds ):
803
803
"""
804
804
`heatmap` visualises tabular data indexed by two key dimensions as a grid of colored values.
805
805
This allows spotting correlations in multivariate data and provides a high-level overview
@@ -822,6 +822,7 @@ def heatmap(self, x=None, y=None, C=None, colorbar=True, **kwds):
822
822
Whether to apply log scaling to the z-axis. Default is False.
823
823
reduce_function : function, optional
824
824
Function to compute statistics for heatmap, for example `np.mean`.
825
+ If omitted, no aggregation is applied and duplicate values are dropped.
825
826
**kwds : optional
826
827
Additional keywords arguments are documented in `hvplot.help('heatmap')`.
827
828
@@ -860,9 +861,19 @@ def heatmap(self, x=None, y=None, C=None, colorbar=True, **kwds):
860
861
- Plotly: https://plotly.com/python/heatmaps/
861
862
- Wiki: https://en.wikipedia.org/wiki/Heat_map
862
863
"""
863
- return self (x , y , kind = 'heatmap' , C = C , colorbar = colorbar , ** kwds )
864
-
865
- def hexbin (self , x = None , y = None , C = None , colorbar = True , ** kwds ):
864
+ return self (x , y , kind = 'heatmap' , C = C , colorbar = colorbar , logz = logz , ** kwds )
865
+
866
+ def hexbin (
867
+ self ,
868
+ x = None ,
869
+ y = None ,
870
+ C = None ,
871
+ colorbar = True ,
872
+ gridsize = 50 ,
873
+ logz = False ,
874
+ min_count = None ,
875
+ ** kwds ,
876
+ ):
866
877
"""
867
878
The `hexbin` plot uses hexagons to split the area into several parts and attribute a color
868
879
to it.
@@ -883,8 +894,12 @@ def hexbin(self, x=None, y=None, C=None, colorbar=True, **kwds):
883
894
Whether to display a colorbar. Default is True.
884
895
reduce_function : function, optional
885
896
Function to compute statistics for hexbins, for example `np.mean`.
886
- gridsize: int, optional
887
- The number of hexagons in the x-direction
897
+ Default aggregation is a count of the values in the area.
898
+ gridsize: int or tuple, optional
899
+ Number of hexagonal bins along x- and y-axes. Defaults to uniform
900
+ sampling along both axes when setting and integer but independent
901
+ bin sampling can be specified a tuple of integers corresponding to
902
+ the number of bins along each axis. Default is 50.
888
903
logz : bool
889
904
Whether to apply log scaling to the z-axis. Default is False.
890
905
min_count : number, optional
@@ -928,9 +943,21 @@ def hexbin(self, x=None, y=None, C=None, colorbar=True, **kwds):
928
943
- Plotly: https://plotly.com/python/hexbin-mapbox/
929
944
- Wiki: https://think.design/services/data-visualization-data-design/hexbin/
930
945
"""
931
- return self (x , y , kind = 'hexbin' , C = C , colorbar = colorbar , ** kwds )
946
+ return self (
947
+ x ,
948
+ y ,
949
+ kind = 'hexbin' ,
950
+ C = C ,
951
+ colorbar = colorbar ,
952
+ gridsize = gridsize ,
953
+ logz = logz ,
954
+ min_count = min_count ,
955
+ ** kwds ,
956
+ )
932
957
933
- def bivariate (self , x = None , y = None , colorbar = True , ** kwds ):
958
+ def bivariate (
959
+ self , x = None , y = None , colorbar = True , bandwidth = None , cut = 3 , filled = False , levels = 10 , ** kwds
960
+ ):
934
961
"""
935
962
A bivariate, density plot uses nested contours (or contours plus colors) to indicate
936
963
regions of higher local density.
@@ -950,12 +977,13 @@ def bivariate(self, x=None, y=None, colorbar=True, **kwds):
950
977
Whether to display a colorbar
951
978
bandwidth: int, optional
952
979
The bandwidth of the kernel for the density estimate. Default is None.
953
- cut: Integer, Optional
954
- Draw the estimate to cut * bw from the extreme data points. Default is None .
980
+ cut: int, optional
981
+ Draw the estimate to cut * bw from the extreme data points. Default is 3 .
955
982
filled : bool, optional
956
- If True the the contours will be filled. Default is False.
957
- levels: int, optional
958
- The number of contour lines to draw. Default is 10.
983
+ If True the contours will be filled. Default is False.
984
+ levels: int or list, optional
985
+ The number of contour lines to draw or a list of scalar values used
986
+ to specify the contour levels. Default is 10.
959
987
960
988
**kwds : optional
961
989
Additional keywords arguments are documented in `hvplot.help('bivariate')`.
@@ -1000,7 +1028,17 @@ def bivariate(self, x=None, y=None, colorbar=True, **kwds):
1000
1028
- Seaborn: https://seaborn.pydata.org/generated/seaborn.kdeplot.html
1001
1029
- Wiki: https://en.wikipedia.org/wiki/Bivariate_analysis
1002
1030
"""
1003
- return self (x , y , kind = 'bivariate' , colorbar = colorbar , ** kwds )
1031
+ return self (
1032
+ x ,
1033
+ y ,
1034
+ kind = 'bivariate' ,
1035
+ colorbar = colorbar ,
1036
+ bandwidth = bandwidth ,
1037
+ cut = cut ,
1038
+ filled = filled ,
1039
+ levels = levels ,
1040
+ ** kwds ,
1041
+ )
1004
1042
1005
1043
def bar (self , x = None , y = None , stacked = False , ** kwds ):
1006
1044
"""
@@ -1289,7 +1327,9 @@ def violin(self, y=None, by=None, **kwds):
1289
1327
"""
1290
1328
return self (kind = 'violin' , x = None , y = y , by = by , ** dict (kwds , hover = False ))
1291
1329
1292
- def hist (self , y = None , by = None , ** kwds ):
1330
+ def hist (
1331
+ self , y = None , by = None , bins = 20 , bin_range = None , normed = False , cumulative = False , ** kwds
1332
+ ):
1293
1333
"""
1294
1334
A `histogram` displays an approximate representation of the distribution of continuous data.
1295
1335
@@ -1302,18 +1342,25 @@ def hist(self, y=None, by=None, **kwds):
1302
1342
Please note the fields should contain continuous data. Not categorical.
1303
1343
by : string or sequence
1304
1344
Field(s) in the *long* data to group by.
1305
- bins : int, optional
1306
- The number of bins
1345
+ bins : int or string or np.ndarray or list or tuple, optional
1346
+ The number of bins in the histogram, or an explicit set of bin edges
1347
+ or a method to find the optimal set of bin edges, e.g. 'auto', 'fd',
1348
+ 'scott' etc. For more documentation on these approaches see the
1349
+ :class:`numpy:numpy.histogram_bin_edges` documentation. Default is 20.
1307
1350
bin_range: tuple, optional
1308
- The lower and upper range of the bins. Default is None.
1309
- normed : bool, optional
1310
- If True the distribution will sum to 1. Default is False.
1311
- cumulative: bool, optional
1312
- If True, then a histogram is computed where each bin gives the counts in that bin plus
1313
- all bins for smaller values. The last bin gives the total number of datapoints.
1351
+ The lower and upper range of the bins.
1352
+ Default is the minimum and maximum values of the continuous data.
1353
+ normed : str or bool, optional
1354
+ Controls normalization behavior. If ``True`` or ``'integral'``, then
1355
+ ``density=True`` is passed to np.histogram, and the distribution
1356
+ is normalized such that the integral is unity. If ``False``,
1357
+ then the frequencies will be raw counts. If ``'height'``, then the
1358
+ frequencies are normalized such that the max bin height is unity.
1314
1359
Default is False.
1315
- alpha : float, optional
1316
- An alpha value between 0.0 and 1.0 to better visualize multiple fields. Default is 1.0.
1360
+ cumulative: bool, optional
1361
+ If True, then a histogram is computed where each bin gives the counts
1362
+ in that bin plus all bins for smaller values. The last bin gives the
1363
+ total number of data points. Default is False.
1317
1364
kwds : optional
1318
1365
Additional keywords arguments are documented in `hvplot.help('hist')`.
1319
1366
@@ -1368,7 +1415,16 @@ def hist(self, y=None, by=None, **kwds):
1368
1415
- Seaborn: https://seaborn.pydata.org/generated/seaborn.histplot.html
1369
1416
- Wiki: https://en.wikipedia.org/wiki/Histogram
1370
1417
"""
1371
- return self (kind = 'hist' , x = None , y = y , by = by , ** kwds )
1418
+ return self (
1419
+ kind = 'hist' ,
1420
+ x = None ,
1421
+ y = y ,
1422
+ by = by ,
1423
+ bins = bins ,
1424
+ normed = normed ,
1425
+ cumulative = cumulative ,
1426
+ ** kwds ,
1427
+ )
1372
1428
1373
1429
def kde (self , y = None , by = None , ** kwds ):
1374
1430
"""
@@ -2252,7 +2308,7 @@ def quadmesh(self, x=None, y=None, z=None, colorbar=True, **kwds):
2252
2308
"""
2253
2309
return self (x , y , z = z , kind = 'quadmesh' , colorbar = colorbar , ** kwds )
2254
2310
2255
- def contour (self , x = None , y = None , z = None , colorbar = True , ** kwds ):
2311
+ def contour (self , x = None , y = None , z = None , colorbar = True , levels = 5 , logz = False , ** kwds ):
2256
2312
"""
2257
2313
Line contour plot
2258
2314
@@ -2266,10 +2322,13 @@ def contour(self, x=None, y=None, z=None, colorbar=True, **kwds):
2266
2322
The coordinate variable along the y-axis
2267
2323
z : string, optional
2268
2324
The data variable to plot
2269
- levels: int, optional
2270
- The number of contour levels
2271
2325
colorbar: boolean
2272
2326
Whether to display a colorbar
2327
+ levels: int or list, optional
2328
+ The number of contour lines to draw or a list of scalar values used
2329
+ to specify the contour levels. Default is 5
2330
+ logz: bool, optional
2331
+ Whether to apply log scaling to the z-axis. Default is False
2273
2332
**kwds : optional
2274
2333
Additional keywords arguments are documented in `hvplot.help('contour')`.
2275
2334
@@ -2313,9 +2372,9 @@ def contour(self, x=None, y=None, z=None, colorbar=True, **kwds):
2313
2372
- Matplotlib: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contour.html
2314
2373
- Plotly: https://plotly.com/python/contour-plots/
2315
2374
"""
2316
- return self (x , y , z = z , kind = 'contour' , colorbar = colorbar , ** kwds )
2375
+ return self (x , y , z = z , kind = 'contour' , colorbar = colorbar , levels = levels , logz = logz , ** kwds )
2317
2376
2318
- def contourf (self , x = None , y = None , z = None , colorbar = True , ** kwds ):
2377
+ def contourf (self , x = None , y = None , z = None , colorbar = True , levels = 5 , logz = False , ** kwds ):
2319
2378
"""
2320
2379
Filled contour plot
2321
2380
@@ -2329,10 +2388,13 @@ def contourf(self, x=None, y=None, z=None, colorbar=True, **kwds):
2329
2388
The coordinate variable along the y-axis
2330
2389
z : string, optional
2331
2390
The data variable to plot
2332
- levels: int, optional
2333
- The number of contour levels
2334
2391
colorbar: boolean
2335
2392
Whether to display a colorbar
2393
+ levels: int, optional
2394
+ The number of contour lines to draw or a list of scalar values used
2395
+ to specify the contour levels. Default is 5
2396
+ logz: bool, optional
2397
+ Whether to apply log scaling to the z-axis. Default is False
2336
2398
**kwds : optional
2337
2399
Additional keywords arguments are documented in `hvplot.help('contourf')`.
2338
2400
@@ -2375,4 +2437,6 @@ def contourf(self, x=None, y=None, z=None, colorbar=True, **kwds):
2375
2437
- Matplotlib: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contour.html
2376
2438
- Plotly: https://plotly.com/python/contour-plots/
2377
2439
"""
2378
- return self (x , y , z = z , kind = 'contourf' , colorbar = colorbar , ** kwds )
2440
+ return self (
2441
+ x , y , z = z , kind = 'contourf' , colorbar = colorbar , levels = levels , logz = logz , ** kwds
2442
+ )
0 commit comments