MCPcopy
hub / github.com/mwaskom/seaborn / kdeplot

Function kdeplot

seaborn/distributions.py:1581–1730  ·  view source on GitHub ↗
(
    data=None, *, x=None, y=None, hue=None, weights=None,
    palette=None, hue_order=None, hue_norm=None, color=None, fill=None,
    multiple="layer", common_norm=True, common_grid=False, cumulative=False,
    bw_method="scott", bw_adjust=1, warn_singular=True, log_scale=None,
    levels=10, thresh=.05, gridsize=200, cut=3, clip=None,
    legend=True, cbar=False, cbar_ax=None, cbar_kws=None, ax=None,
    **kwargs,
)

Source from the content-addressed store, hash-verified

1579
1580
1581def kdeplot(
1582 data=None, *, x=None, y=None, hue=None, weights=None,
1583 palette=None, hue_order=None, hue_norm=None, color=None, fill=None,
1584 multiple="layer", common_norm=True, common_grid=False, cumulative=False,
1585 bw_method="scott", bw_adjust=1, warn_singular=True, log_scale=None,
1586 levels=10, thresh=.05, gridsize=200, cut=3, clip=None,
1587 legend=True, cbar=False, cbar_ax=None, cbar_kws=None, ax=None,
1588 **kwargs,
1589):
1590
1591 # --- Start with backwards compatability for versions < 0.11.0 ----------------
1592
1593 # Handle (past) deprecation of `data2`
1594 if "data2" in kwargs:
1595 msg = "`data2` has been removed (replaced by `y`); please update your code."
1596 raise TypeError(msg)
1597
1598 # Handle deprecation of `vertical`
1599 vertical = kwargs.pop("vertical", None)
1600 if vertical is not None:
1601 if vertical:
1602 action_taken = "assigning data to `y`."
1603 if x is None:
1604 data, y = y, data
1605 else:
1606 x, y = y, x
1607 else:
1608 action_taken = "assigning data to `x`."
1609 msg = textwrap.dedent(f"""\n
1610 The `vertical` parameter is deprecated; {action_taken}
1611 This will become an error in seaborn v0.14.0; please update your code.
1612 """)
1613 warnings.warn(msg, UserWarning, stacklevel=2)
1614
1615 # Handle deprecation of `bw`
1616 bw = kwargs.pop("bw", None)
1617 if bw is not None:
1618 msg = textwrap.dedent(f"""\n
1619 The `bw` parameter is deprecated in favor of `bw_method` and `bw_adjust`.
1620 Setting `bw_method={bw}`, but please see the docs for the new parameters
1621 and update your code. This will become an error in seaborn v0.14.0.
1622 """)
1623 warnings.warn(msg, UserWarning, stacklevel=2)
1624 bw_method = bw
1625
1626 # Handle deprecation of `kernel`
1627 if kwargs.pop("kernel", None) is not None:
1628 msg = textwrap.dedent("""\n
1629 Support for alternate kernels has been removed; using Gaussian kernel.
1630 This will become an error in seaborn v0.14.0; please update your code.
1631 """)
1632 warnings.warn(msg, UserWarning, stacklevel=2)
1633
1634 # Handle deprecation of shade_lowest
1635 shade_lowest = kwargs.pop("shade_lowest", None)
1636 if shade_lowest is not None:
1637 if shade_lowest:
1638 thresh = 0

Callers 15

test_long_vectorsMethod · 0.90
test_flat_vectorMethod · 0.90
test_empty_dataMethod · 0.90
test_singular_dataMethod · 0.90
test_bw_deprecationMethod · 0.90
test_hue_colorsMethod · 0.90
test_hue_stackingMethod · 0.90

Calls 6

_default_colorFunction · 0.85
map_hueMethod · 0.80
_attachMethod · 0.80

Tested by 15

test_long_vectorsMethod · 0.72
test_flat_vectorMethod · 0.72
test_empty_dataMethod · 0.72
test_singular_dataMethod · 0.72
test_bw_deprecationMethod · 0.72
test_hue_colorsMethod · 0.72
test_hue_stackingMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…