Category-wise distributions
Compare a numeric measurement across categories while retaining every observation.
Plotly · Function
px.strip creates an interactive strip chart that displays individual observations across categories or numeric values. It is useful when the points themselves matter more than a summarized box or violin shape.
px.strip creates a strip chart from a data frame, displaying individual observations along categorical or continuous axes. It supports long-form data and, as a 2D Cartesian function, can also process wide-form and mixed-form inputs; the returned figure can then be displayed or further customized.
plotly.express.strip(data_frame=None, x=None, y=None, color=None, ...)| Name | Type | Description |
|---|---|---|
data_frame | DataFrame or array-like | Input data frame containing the columns used by the chart. |
x | str or array-like | Column or data values mapped to the horizontal axis. |
y | str or array-like | Column or data values mapped to the vertical axis. |
color | str or array-like | Column or data values used to assign point colors. |
A Plotly figure containing the generated strip chart.
px.strip also accepts wide-form and mixed-form inputs.px.strip belongs to Plotly Express's group of functions with wide-form and mixed-form support.x, y, and color.import plotly.express as px
df = px.data.tips()
fig = px.strip(df, x="day", y="tip", color="smoker")
fig.show()Creates an interactive strip chart of tip values by day, with points colored by smoking status.
Compare a numeric measurement across categories while retaining every observation.
Show how observations are distributed without hiding outliers behind summary statistics.
Use several columns as separate distributions when the source data is wide-form.
px.strip visualize?px.strip produces a strip chart: individual points are shown without the box or violin body. It is useful for displaying the distribution of observations across categories.
Follow-up: How can it accept multiple data layouts? It accepts long-form data and also supports wide-form and mixed-form input as a 2D Cartesian Plotly Express function.
px.strip?The first positional argument is data_frame. Columns can then be supplied by name through arguments such as x, y, and color.
Follow-up: What is a wide-form call? Pass a list of data-frame column names, such as y=["a", "b"], to trigger wide-form processing.
It returns a Plotly figure generated from the supplied data and encoding options. The figure can be displayed with fig.show() and further configured with Plotly figure methods.
Follow-up: How would you add grouping? Supply a grouping encoding such as color, then customize the returned figure or traces as needed.
px.boxpx.violinpx.scatterplotly.express