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

Skip to content

Commit 0dd9096

Browse files
committed
Deprecate nbagg.transparent rcParam.
1 parent 1928c38 commit 0dd9096

File tree

6 files changed

+8
-15
lines changed

6 files changed

+8
-15
lines changed

doc/api/api_changes/2017-12-15-AL.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecation of the ``nbagg.transparent`` rcParam
2+
````````````````````````````````````````````````
3+
4+
To control transparency of figure patches in the nbagg (or any other) backend,
5+
directly set ``figure.patch.facecolor``, or the ``figure.facecolor`` rcParam.

lib/matplotlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ def gen_candidates():
857857
'svg.image_noscale': ('image.interpolation', None, None),
858858
}
859859

860-
_deprecated_ignore_map = {}
860+
_deprecated_ignore_map = {'nbagg.transparent': 'figure.facecolor'}
861861

862862
_obsolete_set = {'text.dvipnghack', 'legend.isaxes'}
863863

@@ -883,7 +883,7 @@ class RcParams(MutableMapping, dict):
883883
msg_depr = "%s is deprecated and replaced with %s; please use the latter."
884884
msg_depr_set = ("%s is deprecated. Please remove it from your "
885885
"matplotlibrc and/or style files.")
886-
msg_depr_ignore = "%s is deprecated and ignored. Use %s"
886+
msg_depr_ignore = "%s is deprecated and ignored. Use %s instead."
887887
msg_obsolete = ("%s is obsolete. Please remove it from your matplotlibrc "
888888
"and/or style files.")
889889

lib/matplotlib/backends/web_backend/nbagg_uat.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@
399399
"\n",
400400
"### UAT 15 - Figure face colours\n",
401401
"\n",
402-
"The nbagg honours all colours appart from that of the figure.patch. The two plots below should produce a figure with a transparent background and a red background respectively (check the transparency by closing the figure, and dragging the resulting image over other content). There should be no yellow figure."
402+
"The nbagg honours all colours appart from that of the figure.patch. The two plots below should produce a figure with a red background. There should be no yellow figure."
403403
]
404404
},
405405
{
@@ -416,10 +416,6 @@
416416
"plt.figure()\n",
417417
"plt.plot([3, 2, 1])\n",
418418
"\n",
419-
"with matplotlib.rc_context({'nbagg.transparent': False}):\n",
420-
" plt.figure()\n",
421-
"\n",
422-
"plt.plot([3, 2, 1])\n",
423419
"plt.show()"
424420
]
425421
},

lib/matplotlib/mpl-data/stylelib/_classic_test.mplstyle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,6 @@ savefig.transparent : False # setting that controls whether figures are saved
423423
savefig.frameon : True
424424
savefig.orientation : portrait
425425

426-
nbagg.transparent: True
427-
428426
# ps backend params
429427
ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10
430428
ps.useafm : False # use of afm fonts, results in small files

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,6 @@ savefig.transparent : False # setting that controls whether figures are saved
425425
savefig.frameon : True
426426
savefig.orientation : portrait
427427

428-
nbagg.transparent: True
429-
430428
# ps backend params
431429
ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10
432430
ps.useafm : False # use of afm fonts, results in small files

matplotlibrc.template

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ backend : $TEMPLATE_BACKEND
6363
# When True, open the webbrowser to the plot that is shown
6464
# webagg.open_in_browser : True
6565

66-
# When True, the figures rendered in the nbagg backend are created with
67-
# a transparent background.
68-
# nbagg.transparent : False
69-
7066
# if you are running pyplot inside a GUI and your backend choice
7167
# conflicts, we will automatically try to find a compatible one for
7268
# you if backend_fallback is True

0 commit comments

Comments
 (0)