dabl.plot.mosaic_plot

dabl.plot.mosaic_plot(data, rows, cols, vary_lightness=False, ax=None)[source]

Create a mosaic plot from a dataframe.

Right now only horizontal mosaic plots are supported, i.e. rows are prioritized over columns.

Parameters
datapandas data frame

Data to tabulate.

rowscolumn specifier

Column in data to tabulate across rows.

colscolumn specifier

Column in data to use to subpartition rows.

vary_lightnessbool, default=False

Whether to vary lightness across categories.

axmatplotlib axes or None

Axes to plot into.