Skip to content

Commit ee329e8

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

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,11 @@ def gen_candidates():
862862
_obsolete_set = {'text.dvipnghack', 'legend.isaxes'}
863863

864864
# The following may use a value of None to suppress the warning.
865-
_deprecated_set = {'axes.hold'} # do NOT include in _all_deprecated
865+
# Do NOT include in _all_deprecated
866+
_deprecated_set = {
867+
'axes.hold',
868+
'nbagg.transparent',
869+
}
866870

867871
_all_deprecated = set(itertools.chain(
868872
_deprecated_ignore_map, _deprecated_map, _obsolete_set))

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)