Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ffe411

Browse files
kidkoder432meeseeksmachine
authored andcommitted
Backport PR #26462: Boxplot fix median line extending past box boundaries #19409
1 parent 6ab8dbb commit 4ffe411

37 files changed

+21
-1
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4095,7 +4095,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
40954095
40964096
capwidths : float or array-like, default: None
40974097
Either a scalar or a vector and sets the width of each cap.
4098-
The default is ``0.5*(with of the box)``, see *widths*.
4098+
The default is ``0.5*(width of the box)``, see *widths*.
40994099
41004100
vert : bool, default: True
41014101
If `True` (default), makes the boxes vertical.
@@ -4147,6 +4147,17 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
41474147
--------
41484148
.. plot:: gallery/statistics/bxp.py
41494149
"""
4150+
# Clamp median line to edge of box by default.
4151+
medianprops = {
4152+
"solid_capstyle": "butt",
4153+
"dash_capstyle": "butt",
4154+
**(medianprops or {}),
4155+
}
4156+
meanprops = {
4157+
"solid_capstyle": "butt",
4158+
"dash_capstyle": "butt",
4159+
**(meanprops or {}),
4160+
}
41504161

41514162
# lists of artists to be output
41524163
whiskers = []
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)