levelplot

hhpy.plotting.levelplot(data: pandas.core.frame.DataFrame, level: str, cols: Union[list, str], hue: str = None, order: Union[list, str] = None, hue_order: Union[list, str] = None, func: Callable = <function distplot>, summary_title: bool = True, level_title: bool = True, do_print: bool = False, width: int = None, height: int = None, return_fig_ax: bool = None, kwargs_subplots_adjust: Mapping[KT, VT_co] = None, kwargs_summary: Mapping[KT, VT_co] = None, **kwargs) → Union[None, tuple][source]

Plots a plot for each specified column for each level of a certain column plus a summary plot

Parameters:
  • data – Pandas DataFrame containing named data, optional if vector data is used
  • level – the name of the column to split the plots by, must be in data
  • cols – the columns to create plots for, defaults to all numeric columns [optional]
  • hue – Further split the plot by the levels of this variable [optional]
  • order

    Either a string describing how the (hue) levels or to be ordered or an explicit list of levels to be used for plotting. Accepted strings are:

    • sorted: following python standard sorting conventions (alphabetical for string, ascending for value)
    • inv: following python standard sorting conventions but in inverse order
    • count: sorted by value counts
    • mean, mean_ascending, mean_descending: sorted by mean value, defaults to descending
    • median, mean_ascending, median_descending: sorted by median value, defaults to descending
  • hue_order

    Either a string describing how the (hue) levels or to be ordered or an explicit list of levels to be used for plotting. Accepted strings are:

    • sorted: following python standard sorting conventions (alphabetical for string, ascending for value)
    • inv: following python standard sorting conventions but in inverse order
    • count: sorted by value counts
    • mean, mean_ascending, mean_descending: sorted by mean value, defaults to descending
    • median, mean_ascending, median_descending: sorted by median value, defaults to descending
  • func – function to use for plotting, must support 1 positional argument, data, hue, ax and kwargs [optional]
  • summary_title – whether to automatically set the summary plot title [optional]
  • level_title – whether to automatically set the level plot title [optional]
  • do_print – Whether to print intermediate steps to console [optional]
  • width – Width of each individual subplot [optional]
  • height – Height of each individual subplot [optional]
  • return_fig_ax – Whether to return the figure and axes objects as tuple to be captured as fig,ax = …, If False pyplot.show() is called and the plot returns None [optional]
  • kwargs_subplots_adjust – other keyword arguments passed to pyplot.subplots_adjust [optional]
  • kwargs_summary – other keyword arguments passed to summary distplot, if None uses kwargs [optional]
  • kwargs – other keyword arguments passed to func [optional]
Returns:

see return_fig_ax