-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!
Milestone

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?
hehao98, phananh1010, den1s0v and J0ekr
Metadata
Metadata
Assignees
Labels
Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!