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

Skip to content

Commit b1d8b51

Browse files
committed
fix NoneType error test failure
Sometimes the `medianprops` dict was not provided so the previous code was failing to assign a key to it. So a check was added to either modify an exsisting dict or create a new one.
1 parent 6571818 commit b1d8b51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4147,7 +4147,11 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
41474147
--------
41484148
.. plot:: gallery/statistics/bxp.py
41494149
"""
4150-
medianprops["solid_capstyle"] = "butt" # Clamp median line to edge of box
4150+
if medianprops is None: # Clamp median line to edge of box
4151+
medianprops = {"solid_capstyle": "butt"}
4152+
else:
4153+
medianprops["solid_capstyle"] = "butt"
4154+
41514155
# lists of artists to be output
41524156
whiskers = []
41534157
caps = []

0 commit comments

Comments
 (0)