histogram

histogram(data: DataFrame, column: str, ax: Optional[Axes] = None, bins: Optional[int] = None, transform: str = 'identity', clip: float = 0, lower_quantile: float = 0, upper_quantile: float = 1, kde: bool = False, **kwargs) Axes

Plots a histogram of a data column in a pandas DataFrame.

Parameters
  • data – pandas DataFrame containing data to be plotted

  • column – name of column to plot histogram of

  • ax – matplotlib axes to draw plot onto

  • bins – Number of bins to use for the time delta histogram. Default is 0 which translates to automatically determined bins.

  • transform

    Transformation to apply to the data for plotting:

    • ’identity’: no transformation

    • ’log’: apply a logarithmic transformation to the data

  • clip – Value to clip zero values to for log transformation. If 0 (default), zero values are simply removed.

  • lower_quantile – Lower quantile to filter data above

  • upper_quantile – Upper quantile to filter data below

  • kde – Whether to overlay a KDE plot on the histogram

  • kwargs – Additional keyword arguments passed through to [sns.histplot](https://seaborn.pydata.org/generated/seaborn.histplot.html)

Returns

Matplotlib axes object with histogram drawn

Example

(Source code, png, hires.png, pdf)

../_images/intedact-univariate_plots-histogram-1.png