Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitbdcfc97

Browse files
committed
deprecate boxplot:vertical rcparam
1 parent07b29f7 commitbdcfc97

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
``boxplot`` and ``bxp`` *vert* parameter
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

4-
The parameter *vert: bool*has been deprecated on `~.Axes.boxplot` and
5-
`~.Axes.bxp`.
4+
The parameter *vert: bool*and the *boxplot.vertical* rcparam has
5+
been deprecated on `~.Axes.boxplot` and`~.Axes.bxp`.
66
It is replaced by *orientation: {"vertical", "horizontal"}* for API
77
consistency.

‎lib/matplotlib/axes/_axes.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4060,6 +4060,8 @@ def boxplot(self, x, notch=None, sym=None, vert=None,
40604060
labels=tick_labels,autorange=autorange)
40614061
ifnotchisNone:
40624062
notch=mpl.rcParams['boxplot.notch']
4063+
ifvertisNone:
4064+
vert=mpl.rcParams['boxplot.vertical']
40634065
ifpatch_artistisNone:
40644066
patch_artist=mpl.rcParams['boxplot.patchartist']
40654067
ifmeanlineisNone:
@@ -4359,17 +4361,23 @@ def merge_kw_rc(subkey, explicit, zdelta=0, usemarker=True):
43594361
mean_kw[removed_prop]=''
43604362

43614363
# vert and orientation parameters are linked until vert's
4362-
# deprecation period expires.If both are selected,
4363-
#vert takes precedence.
4364-
ifvertisnotNone:
4364+
# deprecation period expires.vert only takes precedence and
4365+
#raises a deprecation warning if set to False.
4366+
ifvertisFalse:
43654367
_api.warn_deprecated(
43664368
"3.10",
43674369
name="vert: bool",
43684370
alternative="orientation: {'vertical', 'horizontal'}"
43694371
)
4370-
orientation='vertical'ifvertelse'horizontal'
4372+
orientation='horizontal'
43714373
_api.check_in_list(['horizontal','vertical'],orientation=orientation)
43724374

4375+
ifnotmpl.rcParams['boxplot.vertical']:
4376+
_api.warn_deprecated(
4377+
"3.10",
4378+
name='boxplot.vertical',obj_type="rcparam"
4379+
)
4380+
43734381
# vertical or horizontal plot?
43744382
maybe_swap=slice(None)iforientation=='vertical'elseslice(None,None,-1)
43754383

‎lib/matplotlib/mpl-data/stylelib/classic.mplstyle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ boxplot.showbox: True
380380
boxplot.showcaps: True
381381
boxplot.showfliers: True
382382
boxplot.showmeans: False
383-
boxplot.vertical: True
384383
boxplot.whiskerprops.color: b
385384
boxplot.whiskerprops.linestyle: --
386385
boxplot.whiskerprops.linewidth: 1.0

‎lib/matplotlib/tests/test_axes.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9061,13 +9061,15 @@ def test_boxplot_orientation(fig_test, fig_ref):
90619061

90629062
plt.close()
90639063

9064-
# Deprecation of `vert: bool` keyword
9064+
# Deprecation of `vert: bool` keyword and
9065+
# 'boxplot.vertical' rcparam.
90659066
withpytest.warns(mpl.MatplotlibDeprecationWarning,
9066-
match='vert: boolwas deprecated in Matplotlib 3.10'):
9067+
match='was deprecated in Matplotlib 3.10'):
90679068
# Compare images between a figure that
90689069
# uses vert and one that uses orientation.
9069-
ax_ref=fig_ref.subplots()
9070-
ax_ref.boxplot(all_data,vert=False)
9070+
withmpl.rc_context({'boxplot.vertical':False}):
9071+
ax_ref=fig_ref.subplots()
9072+
ax_ref.boxplot(all_data)
90719073

90729074
ax_test=fig_test.subplots()
90739075
ax_test.boxplot(all_data,orientation='horizontal')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp