magmaviz.boxplot

Module Contents

Functions

boxplot(df, x, y, facet_col='')

Plot a boxplot with the magma color scheme and an option to facet.

magmaviz.boxplot.boxplot(df, x, y, facet_col='')[source]

Plot a boxplot with the magma color scheme and an option to facet.

Parameters
  • df (dataframe) – Dataframe containing the variables for plotting

  • x (string) – Column name of the numerical variable to view the distribution of

  • y (list) – Column name containing the categorical variables to assign boxes to

  • facet_col (column to use for faceting) – Determines whether separate graphs will be created for each category

Returns

Boxplot displaying distribution of categorical variables with/without faceting

Return type

altair.vegalite.v4.api.Chart

Examples

>>> from magmaviz.magmaviz import boxplot
>>> from vega_datasets import data
>>> boxplot(data.cars(), "Miles_per_Gallon", "Origin", facet_col="Cylinders")