Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Plotly · Function

px.strip

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.

How it works

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.

Syntax

plotly.express.strip(data_frame=None, x=None, y=None, color=None, ...)

Parameters

NameTypeDescription
data_frameDataFrame or array-likeInput data frame containing the columns used by the chart.
xstr or array-likeColumn or data values mapped to the horizontal axis.
ystr or array-likeColumn or data values mapped to the vertical axis.
colorstr or array-likeColumn or data values used to assign point colors.

Returns

A Plotly figure containing the generated strip chart.

Key points

  • The chart emphasizes every observation rather than summarizing the distribution with a visible box.
  • Long-form data is directly supported, with columns mapped to the chart through named arguments.
  • Because it is a 2D Cartesian function, 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.

Common mistakes

  • Pass the data frame first, then refer to its columns by name in arguments such as x, y, and color.

Example: Basic strip chart

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.

When to use it

Category-wise distributions

Compare a numeric measurement across categories while retaining every observation.

Point-level distribution inspection

Show how observations are distributed without hiding outliers behind summary statistics.

Wide-form data exploration

Use several columns as separate distributions when the source data is wide-form.

Interview questions

QWhat does 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.

QHow are data and columns supplied to 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.

QWhat does the function return?

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.box
  • px.violin
  • px.scatter
  • plotly.express

Source: Box plots in Python. Checked 2026-10-15.