Skip to content

Commit cc122c1

Browse files
committed
Reinstate warning as a pending warning
1 parent 2806410 commit cc122c1

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3876,9 +3876,10 @@ def boxplot(self, x, notch=None, sym=None, vert=None,
38763876
38773877
vert : bool, optional
38783878
.. deprecated:: 3.11
3879-
Use of *vert* is discouraged in 3.10 with formal deprecation set
3880-
for 3.11. Use *orientation* instead.
3879+
Use *orientation* instead.
38813880
3881+
This is a pending deprecation for 3.10, with full deprecation
3882+
in 3.11 and removal in 3.13.
38823883
If this is given during the deprecation period, it overrides
38833884
the *orientation* parameter.
38843885
@@ -4224,9 +4225,10 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=None,
42244225
42254226
vert : bool, optional
42264227
.. deprecated:: 3.11
4227-
Use of *vert* is discouraged in 3.10 with formal deprecation
4228-
set for 3.11. Use *orientation* instead.
4228+
Use *orientation* instead.
42294229
4230+
This is a pending deprecation for 3.10, with full deprecation
4231+
in 3.11 and removal in 3.13.
42304232
If this is given during the deprecation period, it overrides
42314233
the *orientation* parameter.
42324234
@@ -4361,6 +4363,13 @@ def merge_kw_rc(subkey, explicit, zdelta=0, usemarker=True):
43614363
# if set to False.
43624364
if vert is None:
43634365
vert = mpl.rcParams['boxplot.vertical']
4366+
else:
4367+
_api.warn_deprecated(
4368+
"3.11",
4369+
name="vert: bool",
4370+
alternative="orientation: {'vertical', 'horizontal'}",
4371+
pending=True,
4372+
)
43644373
if vert is False:
43654374
orientation = 'horizontal'
43664375
_api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
@@ -8637,6 +8646,12 @@ def violin(self, vpstats, positions=None, vert=None,
86378646
# deprecation period expires. If both are selected,
86388647
# vert takes precedence.
86398648
if vert is not None:
8649+
_api.warn_deprecated(
8650+
"3.11",
8651+
name="vert: bool",
8652+
alternative="orientation: {'vertical', 'horizontal'}",
8653+
pending=True,
8654+
)
86408655
orientation = 'vertical' if vert else 'horizontal'
86418656
_api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
86428657

lib/matplotlib/tests/test_axes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9315,7 +9315,10 @@ def test_violinplot_orientation(fig_test, fig_ref):
93159315
# Compare images between a figure that
93169316
# uses vert and one that uses orientation.
93179317
ax_ref = fig_ref.subplots()
9318-
ax_ref.violinplot(all_data, vert=False)
9318+
9319+
with pytest.warns(PendingDeprecationWarning,
9320+
match='vert: bool'):
9321+
ax_ref.violinplot(all_data, vert=False)
93199322

93209323
ax_test = fig_test.subplots()
93219324
ax_test.violinplot(all_data, orientation='horizontal')

0 commit comments

Comments
 (0)