Boxplot позволяет передавать объект для flierprops
.
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Mock data from the boxplot demo
spread = np.random.rand(50) * 100
center = np.ones(25) * 50
flier_high = np.random.rand(10) * 100 + 100
flier_low = np.random.rand(10) * -100
data = np.concatenate((spread, center, flier_high, flier_low))
# Set up
fig, ax = plt.subplots()
# flierprops example
red_square = dict(markerfacecolor='r', marker='s')
box = ax.boxplot(data, flierprops=red_square)
Этот простой образец производит:

Если вы хотите что-то пометить, вы можете использовать plt.annotate
примерно так:
box = ax.boxplot(data,)
top_points = box["fliers"][0].get_data()
ax.scatter(top_points[0], top_points[1], marker="o")
# Roughly based on https://stackoverflow.com/a/5147430/10553976
ax.annotate("I labeled this", xy=(top_points[0][1], top_points[1][1]),
xytext=(-20, 20),
textcoords='offset points', ha='right', va='bottom',
bbox=dict(boxstyle='round,pad=0.5', fc='yellow', alpha=0.5),
arrowprops=dict(arrowstyle = '->', connectionstyle='arc3,rad=0'))
И этот образец производит:
