Closed

Description
When changing the linewidth
property of the median line in boxplots, the line will extend beyond the box width.
For example,
import matplotlib.pyplot as plt
data = [[1, 2, 3, 4, 5]]
fig, ax = plt.subplots()
ax.boxplot(data,
medianprops={"linewidth": 8})
By simply chaning the solid_capstyle
propery to "butt"
in
ax.boxplot(data,
medianprops={"linewidth": 8,
"solid_capstyle": "butt"})
I was able to improve this a bit (I stole that trick from here):
Ideally, one could now reduce the median line length such that it no longer overlaps with the black bounding line of the box.
Since the box line width is only accessible in "points" units, it would need to be transformed to data units.
I was unable to get this to work, though.
Would it be possible/desirable to change the default setting for solid_capstyle
?
Could this be handled in a different way?