Boxplot Min/Max Values and Overlaying Points Issues
12:11 11 Feb 2026

I am trying to plot various isotope fractionation values in a boxplot. I have most of the code but I'm having two main issues:

  1. The min and max error bars don't show up for every box and
  2. Adding a horizontal jitter creates one empty white circle with a black outline and I'd like that to go away.

More specifically, the minimum error bar is missing for the first box and the maximum error bar is missing for the third and fourth boxes. Additionally, you can see the empty black circles in the third and fourth plots. If anything, that's where the error bars need to reach. I will attach a picture below of the output and I will attach my code here:

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

df = pd.read_excel("fractionation_data.xlsx")
# df = pd.read_csv("fractionation_data.csv")

#Ensure fractionation values are numeric
df["Fractionation"] = pd.to_numeric(df["Fractionation"], errors="coerce")

#Drop rows with missing values
df = df.dropna(subset=["Plant", "Fractionation"])

#Get unique plant categories (keeps spreadsheet order)
plants = df["Plant"].unique()

#Create a list of fractionation arrays, one per plant
data = [
    df[df["Plant"] == plant]["Fractionation"].values
    for plant in plants
]

plt.figure(figsize=(8, 6))

plt.boxplot(data, labels=plants)


#Overlay individual points
for i, plant_data in enumerate(data, start=1):
    # Add slight horizontal jitter so points don’t overlap
    x = np.random.normal(i, 0.04, size=len(plant_data))
    plt.plot(x, plant_data, 'o')


plt.xlabel("Algae Type")
plt.ylabel("Fractionation (‰)")
plt.title("Fractionation Values by Algae Type")
plt.xticks(rotation=45)

plt.tight_layout()
plt.show()

Boxplot Image

python matplotlib boxplot