hvPlot.box#
- hvPlot.box(y=None, by=None, **kwds)[source]#
The box plot gives you a visual idea about the locality, spread and skewness of numerical data through their quartiles. It is also known as box and whiskers plot.
box plots are most useful when grouped by additional dimensions.
Reference: https://hvplot.holoviz.org/reference/tabular/box.html
- Parameters:
- ystring or sequence
Field(s) in the wide data to compute distribution from. If none is provided all numerical fields will be used.
- bystring or sequence
Field in the long data to group by.
- kwdsoptional
Additional keywords arguments are documented in hvplot.help(‘box’). See Plotting Options for more information.
- Returns:
holoviews.element.BoxWhisker
/ Panel objectYou can print the object to study its composition and run:
import holoviews as hv hv.help(the_holoviews_object)
to learn more about its parameters and options.
References
Bokeh: https://docs.bokeh.org/en/latest/docs/gallery/boxplot.html
HoloViews: https://holoviews.org/reference/elements/bokeh/BoxWhisker.html
Matplotlib: https://matplotlib.org/stable/plot_types/stats/boxplot_plot.html#sphx-glr-plot-types-stats-boxplot-plot-py
Pandas: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.boxplot.html
Examples
Here is an example using wide data.
import hvplot.pandas import numpy as np import pandas as pd data = np.random.randn(25, 4) df = pd.DataFrame(data, columns=list('ABCD')) df.hvplot.box()
Here is an example using long data and the by argument.
import hvplot.pandas # noqa import pandas as pd age_list = [8, 10, 12, 14, 72, 74, 76, 78, 20, 25, 30, 35, 60, 85] df = pd.DataFrame({"gender": list("MMMMMMMMFFFFFF"), "age": age_list}) df.hvplot.box(y='age', by='gender', height=400, width=400, legend=False, ylim=(0, None))
Backend-specific styling options#
box_alpha, box_cmap, box_color, box_fill_alpha, box_fill_color, box_hover_alpha, box_hover_color, box_hover_fill_alpha, box_hover_fill_color, box_hover_line_alpha, box_hover_line_cap, box_hover_line_color, box_hover_line_dash, box_hover_line_dash_offset, box_hover_line_join, box_hover_line_width, box_line_alpha, box_line_cap, box_line_color, box_line_dash, box_line_dash_offset, box_line_join, box_line_width, box_muted, box_muted_alpha, box_muted_color, box_muted_fill_alpha, box_muted_fill_color, box_muted_line_alpha, box_muted_line_cap, box_muted_line_color, box_muted_line_dash, box_muted_line_dash_offset, box_muted_line_join, box_muted_line_width, box_nonselection_alpha, box_nonselection_color, box_nonselection_fill_alpha, box_nonselection_fill_color, box_nonselection_line_alpha, box_nonselection_line_cap, box_nonselection_line_color, box_nonselection_line_dash, box_nonselection_line_dash_offset, box_nonselection_line_join, box_nonselection_line_width, box_selection_alpha, box_selection_color, box_selection_fill_alpha, box_selection_fill_color, box_selection_line_alpha, box_selection_line_cap, box_selection_line_color, box_selection_line_dash, box_selection_line_dash_offset, box_selection_line_join, box_selection_line_width, box_visible, box_width, cmap, outlier_alpha, outlier_color, outlier_fill_alpha, outlier_fill_color, outlier_hover_alpha, outlier_hover_color, outlier_hover_fill_alpha, outlier_hover_fill_color, outlier_hover_line_alpha, outlier_hover_line_cap, outlier_hover_line_color, outlier_hover_line_dash, outlier_hover_line_dash_offset, outlier_hover_line_join, outlier_hover_line_width, outlier_line_alpha, outlier_line_cap, outlier_line_color, outlier_line_dash, outlier_line_dash_offset, outlier_line_join, outlier_line_width, outlier_muted_alpha, outlier_muted_color, outlier_muted_fill_alpha, outlier_muted_fill_color, outlier_muted_line_alpha, outlier_muted_line_cap, outlier_muted_line_color, outlier_muted_line_dash, outlier_muted_line_dash_offset, outlier_muted_line_join, outlier_muted_line_width, outlier_nonselection_alpha, outlier_nonselection_color, outlier_nonselection_fill_alpha, outlier_nonselection_fill_color, outlier_nonselection_line_alpha, outlier_nonselection_line_cap, outlier_nonselection_line_color, outlier_nonselection_line_dash, outlier_nonselection_line_dash_offset, outlier_nonselection_line_join, outlier_nonselection_line_width, outlier_selection_alpha, outlier_selection_color, outlier_selection_fill_alpha, outlier_selection_fill_color, outlier_selection_line_alpha, outlier_selection_line_cap, outlier_selection_line_color, outlier_selection_line_dash, outlier_selection_line_dash_offset, outlier_selection_line_join, outlier_selection_line_width, whisker_alpha, whisker_color, whisker_hover_alpha, whisker_hover_color, whisker_hover_line_alpha, whisker_hover_line_cap, whisker_hover_line_color, whisker_hover_line_dash, whisker_hover_line_dash_offset, whisker_hover_line_join, whisker_hover_line_width, whisker_line_alpha, whisker_line_cap, whisker_line_color, whisker_line_dash, whisker_line_dash_offset, whisker_line_join, whisker_line_width, whisker_muted, whisker_muted_alpha, whisker_muted_color, whisker_muted_line_alpha, whisker_muted_line_cap, whisker_muted_line_color, whisker_muted_line_dash, whisker_muted_line_dash_offset, whisker_muted_line_join, whisker_muted_line_width, whisker_nonselection_alpha, whisker_nonselection_color, whisker_nonselection_line_alpha, whisker_nonselection_line_cap, whisker_nonselection_line_color, whisker_nonselection_line_dash, whisker_nonselection_line_dash_offset, whisker_nonselection_line_join, whisker_nonselection_line_width, whisker_selection_alpha, whisker_selection_color, whisker_selection_line_alpha, whisker_selection_line_cap, whisker_selection_line_color, whisker_selection_line_dash, whisker_selection_line_dash_offset, whisker_selection_line_join, whisker_selection_line_width, whisker_visible
bootstrap, boxprops, capprops, conf_intervals, flierprops, meanline, meanprops, medianprops, notch, show_caps, showfliers, showmeans, sym, whis, whiskerprops, widths
Examples#
TBD