Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f356da1

Browse filesBrowse files
committed
Delay warning for deprecated parameter 'vert' of box and violin on 3.10
The new parameter, 'orientation', was only added in the current release, so downstream wanting to avoid warnings would require version gates. Therefore delaying by at least one release to ease the transition. This was motivated by Pandas failing tests on this warning. This portion is made direct to v3.10.x with #29155 being the accompanying version to edit the deprecation on main. Reinstate warning as a pending warning STY: fits on one line
1 parent 82f7254 commit f356da1
Copy full SHA for f356da1

File tree

Expand file treeCollapse file tree

2 files changed

+16
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+16
-8
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+13-7Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3875,9 +3875,11 @@ def boxplot(self, x, notch=None, sym=None, vert=None,
38753875
control is provided by the *flierprops* parameter.
38763876
38773877
vert : bool, optional
3878-
.. deprecated:: 3.10
3878+
.. deprecated:: 3.11
38793879
Use *orientation* instead.
38803880
3881+
This is a pending deprecation for 3.10, with full deprecation
3882+
in 3.11 and removal in 3.13.
38813883
If this is given during the deprecation period, it overrides
38823884
the *orientation* parameter.
38833885
@@ -4222,9 +4224,11 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=None,
42224224
The default is ``0.5*(width of the box)``, see *widths*.
42234225
42244226
vert : bool, optional
4225-
.. deprecated:: 3.10
4227+
.. deprecated:: 3.11
42264228
Use *orientation* instead.
42274229
4230+
This is a pending deprecation for 3.10, with full deprecation
4231+
in 3.11 and removal in 3.13.
42284232
If this is given during the deprecation period, it overrides
42294233
the *orientation* parameter.
42304234
@@ -4361,9 +4365,10 @@ def merge_kw_rc(subkey, explicit, zdelta=0, usemarker=True):
43614365
vert = mpl.rcParams['boxplot.vertical']
43624366
else:
43634367
_api.warn_deprecated(
4364-
"3.10",
4368+
"3.11",
43654369
name="vert: bool",
4366-
alternative="orientation: {'vertical', 'horizontal'}"
4370+
alternative="orientation: {'vertical', 'horizontal'}",
4371+
pending=True,
43674372
)
43684373
if vert is False:
43694374
orientation = 'horizontal'
@@ -8642,10 +8647,11 @@ def violin(self, vpstats, positions=None, vert=None,
86428647
# vert takes precedence.
86438648
if vert is not None:
86448649
_api.warn_deprecated(
8645-
"3.10",
8650+
"3.11",
86468651
name="vert: bool",
8647-
alternative="orientation: {'vertical', 'horizontal'}"
8648-
)
8652+
alternative="orientation: {'vertical', 'horizontal'}",
8653+
pending=True,
8654+
)
86498655
orientation = 'vertical' if vert else 'horizontal'
86508656
_api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
86518657

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9315,7 +9315,9 @@ 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, match='vert: bool'):
9320+
ax_ref.violinplot(all_data, vert=False)
93199321

93209322
ax_test = fig_test.subplots()
93219323
ax_test.violinplot(all_data, orientation='horizontal')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.