qis.df_boxplot_by_classification_var¶
- qis.df_boxplot_by_classification_var(df, x, y, num_buckets=6, x_hue_name='x_regimes', hue=None, hue_order=None, title=None, is_add_xlabel=True, xvar_format='{:.2f}', yvar_format='{:.2f}', showfliers=False, showmeans=False, meanline=False, medianline=True, add_xy_mean_labels=False, add_xy_med_labels=False, is_value_labels=True, colors=None, ax=None, **kwargs)[source]¶
box plots of y within quantile buckets of x.
The non-parametric counterpart to
plot_classification_scatter(): instead of fitting a line within each bucket of x, it shows the whole conditional distribution of y. Use it where the relationship is not expected to be linear, or where the tails of the conditional distribution are the subject — conditional drawdown, say, rather than conditional mean.Arguments shared with every
plot_*function are documented inqis/docs/plotting_kwargs.md.- Parameters:
df (DataFrame) – data to plot
x (str) – column bucketed into quantiles, and the horizontal axis
y (str) – column whose conditional distribution each box describes
num_buckets (int) – number of equally populated quantile buckets of x
x_hue_name (str) – name given to the generated bucket column
hue (str | None) – further column splitting each bucket into side-by-side boxes
hue_order (List[str]) – order of the hue values, left to right within a bucket
is_add_xlabel (bool) – label the horizontal axis with the bucket ranges
showfliers (bool) – draw outliers beyond the whiskers as points. Off by default, since on a return panel the fliers dominate the ink
showmeans (bool) – mark the mean of each box
meanline (bool) – draw the mean as a line rather than a marker
medianline (bool) – draw the median as a line
add_xy_mean_labels (bool) – annotate each box with the mean of x and of y in that bucket
add_xy_med_labels (bool) – annotate each box with the medians instead
is_value_labels (bool) – label the buckets with their x ranges rather than their ordinals
title (str)
xvar_format (str)
yvar_format (str)
ax (Axes)
- Returns:
None; the supplied or created axis is drawn on
- Return type:
None