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

Skip to content

Commit 0723cd5

Browse files
committed
Set None be the default for box plot zorder
1 parent 8146094 commit 0723cd5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,7 +3095,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
30953095
showbox=None, showfliers=None, boxprops=None,
30963096
labels=None, flierprops=None, medianprops=None,
30973097
meanprops=None, capprops=None, whiskerprops=None,
3098-
manage_xticks=True, autorange=False, zorder=2):
3098+
manage_xticks=True, autorange=False, zorder=None):
30993099
"""
31003100
Make a box and whisker plot.
31013101
@@ -3108,7 +3108,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
31083108
showbox=True, showfliers=True, boxprops=None,
31093109
labels=None, flierprops=None, medianprops=None,
31103110
meanprops=None, capprops=None, whiskerprops=None,
3111-
manage_xticks=True, autorange=False, zorder=2):
3111+
manage_xticks=True, autorange=False, zorder=None):
31123112
31133113
Make a box and whisker plot for each column of ``x`` or each
31143114
vector in sequence ``x``. The box extends from the lower to
@@ -3220,7 +3220,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
32203220
``shownotches`` is also True. Otherwise, means will be shown
32213221
as points.
32223222
3223-
zorder : scalar, optional (2)
3223+
zorder : scalar, optional (None)
32243224
Sets the zorder of the boxplot.
32253225
32263226
Other Parameters
@@ -3385,6 +3385,10 @@ def _update_dict(dictionary, rc_name, properties):
33853385
if ci[1] is not None:
33863386
stats['cihi'] = ci[1]
33873387

3388+
# Use default zorder if none specified
3389+
if zorder is None:
3390+
zorder = mlines.Line2D.zorder
3391+
33883392
artists = self.bxp(bxpstats, positions=positions, widths=widths,
33893393
vert=vert, patch_artist=patch_artist,
33903394
shownotches=notch, showmeans=showmeans,
@@ -3412,7 +3416,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
34123416
showcaps=True, showbox=True, showfliers=True,
34133417
boxprops=None, whiskerprops=None, flierprops=None,
34143418
medianprops=None, capprops=None, meanprops=None,
3415-
meanline=False, manage_xticks=True, zorder=2):
3419+
meanline=False, manage_xticks=True, zorder=None):
34163420
34173421
Make a box and whisker plot for each column of *x* or each
34183422
vector in sequence *x*. The box extends from the lower to
@@ -3516,7 +3520,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
35163520
manage_xticks : bool, default = True
35173521
If the function should adjust the xlim and xtick locations.
35183522
3519-
zorder : scalar, default = 2
3523+
zorder : scalar, default = None
35203524
The zorder of the resulting boxplot
35213525
35223526
Returns

0 commit comments

Comments
 (0)