Skip to content

Commit 1e312d0

Browse files
committed
move rcparam setting to bxp & fix test
1 parent 10b7d65 commit 1e312d0

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

lib/matplotlib/axes/_axes.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -3878,7 +3878,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None,
38783878
the fliers. If `None`, then the fliers default to 'b+'. More
38793879
control is provided by the *flierprops* parameter.
38803880
3881-
vert : bool, default: :rc:`boxplot.vertical`
3881+
vert : bool, optional
38823882
.. deprecated:: 3.10
38833883
Use *orientation* instead.
38843884
@@ -4060,8 +4060,6 @@ def boxplot(self, x, notch=None, sym=None, vert=None,
40604060
labels=tick_labels, autorange=autorange)
40614061
if notch is None:
40624062
notch = mpl.rcParams['boxplot.notch']
4063-
if vert is None:
4064-
vert = mpl.rcParams['boxplot.vertical']
40654063
if patch_artist is None:
40664064
patch_artist = mpl.rcParams['boxplot.patchartist']
40674065
if meanline is None:
@@ -4227,7 +4225,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=None,
42274225
Either a scalar or a vector and sets the width of each cap.
42284226
The default is ``0.5*(width of the box)``, see *widths*.
42294227
4230-
vert : bool, default: True
4228+
vert : bool, optional
42314229
.. deprecated:: 3.10
42324230
Use *orientation* instead.
42334231
@@ -4361,14 +4359,17 @@ def merge_kw_rc(subkey, explicit, zdelta=0, usemarker=True):
43614359
mean_kw[removed_prop] = ''
43624360

43634361
# vert and orientation parameters are linked until vert's
4364-
# deprecation period expires. vert only takes precedence and
4365-
# raises a deprecation warning if set to False.
4366-
if vert is False:
4362+
# deprecation period expires. vert only takes precedence
4363+
# if set to False.
4364+
if vert is None:
4365+
vert = mpl.rcParams['boxplot.vertical']
4366+
else:
43674367
_api.warn_deprecated(
43684368
"3.10",
43694369
name="vert: bool",
43704370
alternative="orientation: {'vertical', 'horizontal'}"
4371-
)
4371+
)
4372+
if vert is False:
43724373
orientation = 'horizontal'
43734374
_api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
43744375

lib/matplotlib/tests/test_axes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3186,7 +3186,7 @@ def _bxp_test_helper(
31863186
logstats = mpl.cbook.boxplot_stats(
31873187
np.random.lognormal(mean=1.25, sigma=1., size=(37, 4)), **stats_kwargs)
31883188
fig, ax = plt.subplots()
3189-
if not bxp_kwargs.get('orientation') or bxp_kwargs.get('orientation') == 'vertical':
3189+
if bxp_kwargs.get('orientation', 'vertical') == 'vertical':
31903190
ax.set_yscale('log')
31913191
else:
31923192
ax.set_xscale('log')

0 commit comments

Comments
 (0)