Strip plot

Seaborn basics

2 min read

Published Oct 7 2025


24
0
0
0

ChartsGraphsMatplotlibNumPyPandasPythonSeabornVisualisation

seaborn.stripplot() displays individual data points for a numerical variable across categories.
It’s a type of scatter plot where:

  • The x-axis (or y-axis) shows categories
  • The other axis shows numeric values
  • Each dot represents one observation

It’s great for:

  • Showing raw data instead of summary statistics
  • Understanding data distribution, density, and outliers

Syntax:

sns.stripplot(
    data=None,
    x=None,
    y=None,
    hue=None,
    order=None,
    hue_order=None,
    jitter=True,
    dodge=False,
    orient=None,
    color=None,
    palette=None,
    size=5,
    alpha=None,
    marker='o',
    linewidth=0,
    **kwargs
)

Parameters:

  • data = DataFrame containing your data
  • x, y = Categorical and numeric variables
  • hue = Adds subcategories (colours)
  • jitter = Adds random noise to avoid overlapping points (default: True)
  • dodge = Separates hue categories side by side
  • palette = Colour palette for hue
  • size = Dot size
  • alpha = Transparency (0 to 1)
  • marker = Shape of the points
  • linewidth = Outline thickness for points




Basic example

import seaborn as sns
import matplotlib.pyplot as plt

tips = sns.load_dataset("tips")

sns.stripplot(data=tips, x="day", y="total_bill")
plt.show()

Each dot = one observation of total_bill for a given day.


seaborn strip plot basic example





Add hue (subgroups)

import seaborn as sns
import matplotlib.pyplot as plt

tips = sns.load_dataset("tips")

sns.stripplot(data=tips, x="day", y="total_bill", hue="sex", palette="Set2")
plt.show()

  • Dots are coloured by sex.
  • Default behaviour: dots from different hue groups overlap slightly.

seaborn strip plot hue example





Separate subgroups (dodge)

import seaborn as sns
import matplotlib.pyplot as plt

tips = sns.load_dataset("tips")

sns.stripplot(data=tips, x="day", y="total_bill", hue="sex", dodge=True, palette="pastel")
plt.show()

Dots for different hue groups appear side by side, avoiding overlap.


seaborn strip plot dodge example





Control jitter (spread of points)

import seaborn as sns
import matplotlib.pyplot as plt

tips = sns.load_dataset("tips")

sns.stripplot(data=tips, x="day", y="total_bill", jitter=0.2)
plt.show()

  • jitter=True (default): spreads points horizontally for visibility.
  • jitter=0: stacks points directly above each other (no spread).

seaborn strip plot jitter example





Horizontal orientation

import seaborn as sns
import matplotlib.pyplot as plt

tips = sns.load_dataset("tips")

sns.stripplot(data=tips, x="total_bill", y="day", orient="h")
plt.show()

Flips the orientation — useful for long category names.


seaborn strip plot horizontal example





Customise style and colors

import seaborn as sns
import matplotlib.pyplot as plt

tips = sns.load_dataset("tips")

sns.stripplot(
    data=tips,
    x="day",
    y="total_bill",
    hue="sex",
    dodge=True,
    palette="coolwarm",
    size=6,
    alpha=0.7,
    linewidth=0.5,
    edgecolor="black"
)
plt.show()

  • size → dot size
  • alpha → transparency
  • linewidth + edgecolor → outline styling

seaborn strip plot style colour example
© 2025 SimpleSteps.guide
AboutFAQPoliciesContact