iqplot.stripbox
- iqplot.stripbox(data=None, q=None, cats=None, q_axis='x', palette=None, order=None, p=None, show_legend=False, legend_location='right', legend_orientation='vertical', legend_click_policy='hide', top_level='strip', color_column=None, parcoord_column=None, tooltips=None, marker='circle', spread=None, cat_grid=False, marker_kwargs=None, jitter_kwargs=None, swarm_kwargs=None, parcoord_kwargs=None, whisker_caps=True, display_points=True, min_data=5, box_kwargs=None, median_kwargs=None, whisker_kwargs=None, jitter=None, horizontal=None, val=None, click_policy=None, **kwargs)
Make a strip plot with a box plot as annotation.
- Parameters:
data (Pandas DataFrame, 1D Numpy array, or xarray) – DataFrame containing tidy data for plotting. If a Numpy array, a single category is assumed and a strip plot generated from data.
q (hashable) – Name of column to use as quantitative variable if data is a Pandas DataFrame. Otherwise, q is used as the quantitative axis label.
cats (hashable or list of hashables) – Name of column(s) to use as categorical variable(s).
q_axis (str, either 'x' or 'y', default 'x') – Axis along which the quantitative value varies.
palette (list of strings of hex colors, or single hex string) – If a list, color palette to use. If a single string representing a hex color, all glyphs are colored with that color. Default is colorcet.b_glasbey_category10 from the colorcet package.
order (list or None) – If not None, must be a list of unique group names when the input data frame is grouped by cats. The order of the list specifies the ordering of the categorical variables on the categorical axis and legend. If None, the categories appear in the order in which they appeared in the inputted data frame.
p (bokeh.plotting.Figure instance, or None (default)) – If None, create a new figure. Otherwise, populate the existing figure p.
top_level (str, default 'strip') – If ‘box’, the box plot is overlaid. If ‘strip’, the strip plot is overlaid.
show_legend (bool, default False) – If True, display legend.
legend_location (str, default 'right') – Location of legend. If one of “right”, “left”, “above”, or “below”, the legend is placed outside of the plot area. If one of “top_left”, “top_center”, “top_right”, “center_right”, “bottom_right”, “bottom_center”, “bottom_left”, “center_left”, or “center”, the legend is placed within the plot area. If a 2-tuple, legend is placed according to the coordinates in the tuple.
legend_orientation (str, default 'vertical') – Either ‘horizontal’ or ‘vertical’.
legend_click_policy (str, default 'hide') – Either ‘hide’, ‘mute’, or None; how the glyphs respond when the corresponding category is clicked in the legend.
color_column (hashable, default None) – Column of data to use in determining color of glyphs. The data in the color_column are assumed to be categorical. If the data in color_column consist entirely of hex colors, then those colors are directly used to color the glyphs. If None, then cats is used.
parcoord_column (hashable, default None) – Column of data to use to construct a parallel coordinate plot. Data points with like entries in the parcoord_column are connected with lines in the strip plot.
tooltips (list of 2-tuples) – Specification for tooltips as per Bokeh specifications. For example, if we want col1 and col2 tooltips, we can use tooltips=[(‘label 1’: ‘@col1’), (‘label 2’: ‘@col2’)].
marker (str, default 'circle') – Name of marker to be used in the plot (ignored if formal is False). Must be one of[‘asterisk’, ‘circle’, ‘circle_cross’, ‘circle_x’, ‘cross’, ‘dash’, ‘diamond’, ‘diamond_cross’, ‘hex’, ‘inverted_triangle’, ‘square’, ‘square_cross’, ‘square_x’, ‘triangle’, ‘x’]
spread (str or None, default None) – If ‘jitter’, spread points out using a jitter transform. If ‘swarm’, spread points in beeswarm style. In None or ‘none’, do not spread.
cat_grid (bool, default False) – If True, display grid line for categorical axis.
marker_kwargs (dict) – Keyword arguments to pass when adding markers to the plot. [“x”, “y”, “marker”, “source”, “cat”, “legend”] are not allowed because they are determined by other inputs.
jitter_kwargs (dict) – Keyword arguments to be passed to bokeh.transform.jitter(). If not specified, default is {‘distribution’: ‘normal’, ‘width’: 0.1}. If the user specifies {‘distribution’: ‘uniform’}, the ‘width’ entry is adjusted to 0.4. Only active if spread is ‘jitter’.
swarm_kwargs (dict) –
Keyword arguments for use in generating swarm. Only active if spread is ‘swarm’. Keys with allowed values are:
’corral’: Either ‘gutter’ (default) or ‘wrap’. This
specifies how points that are moved too far out are dealt with. Using ‘gutter’, points are overlayed at the maximum allowed distance. Using ‘wrap’, points are reflected inwards form the maximal extent and possibly overlayed with other points.
’priority’: Either ‘ascending’ (default) or ‘descending’.
Sort order when determining which points get moved in the y-direction first.
marker_pad_px : Gap between markers in units of pixels,
default 0.
parcoord_kwargs (dict) – Keyword arguments to be passed to p.line() when making lines for kwargs. Default is to have one-pixel gray lines.
whisker_caps (bool, default True) – If True, put caps on whiskers. If False, omit caps.
min_data (int, default 5) – Minimum number of data points in a given category in order to make a box and whisker. Otherwise, individual data points are plotted as in a strip plot.
box_kwargs (dict, default None) – A dictionary of kwargs to be passed into p.hbar() or p.vbar() when constructing the boxes for the box plot.
median_kwargs (dict, default None) – A dictionary of kwargs to be passed into p.hbar() or p.vbar() when constructing the median line for the box plot.
whisker_kwargs (dict, default None) – A dictionary of kwargs to be passed into p.segment() when constructing the whiskers for the box plot.
jitter (bool, default False) – Deprecated, use spread.
horizontal (bool or None, default None) – Deprecated. Use q_axis.
val (hashable) – Deprecated, use q.
click_policy (str, default 'hide') – Deprecated. Use legend_click_policy.
kwargs – Any kwargs to be passed to bokeh.plotting.figure() when instantiating the figure.
- Returns:
output – Plot populated with a strip-box plot.
- Return type:
bokeh.plotting.Figure instance