depictr.explore_distribution#

depictr.explore_distribution(data, x, group=None, kind='density', bins=30, alpha=0.6, legend_inside=False, title=None)#

Plot the distribution of a numeric variable, optionally split by a group.

Parameters:
  • data (pandas.DataFrame) – The data.

  • x (str) – Name of the numeric column to display.

  • group (str, optional) – A grouping column mapped to colour/fill.

  • kind ({"density", "histogram", "both"}) – What to draw.

  • bins (int) – Number of histogram bins.

  • alpha (float) – Fill transparency, useful when groups overlap.

  • legend_inside (bool) – When True and a group is given, place the legend inside the top-right of the panel (a unimodal distribution leaves it empty) rather than in a right-hand margin.

  • title (str, optional) – Plot title.

Return type:

plotnine.ggplot