Skip to content

Deprecate nbagg.transparent rcParam. #10024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/api/api_changes/2017-12-15-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Deprecation of the ``nbagg.transparent`` rcParam
````````````````````````````````````````````````

To control transparency of figure patches in the nbagg (or any other) backend,
directly set ``figure.patch.facecolor``, or the ``figure.facecolor`` rcParam.
4 changes: 2 additions & 2 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ def gen_candidates():
'svg.image_noscale': ('image.interpolation', None, None),
}

_deprecated_ignore_map = {}
_deprecated_ignore_map = {'nbagg.transparent': 'figure.facecolor'}

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

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

Expand Down
6 changes: 1 addition & 5 deletions lib/matplotlib/backends/web_backend/nbagg_uat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
"\n",
"### UAT 15 - Figure face colours\n",
"\n",
"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."
"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."
]
},
{
Expand All @@ -416,10 +416,6 @@
"plt.figure()\n",
"plt.plot([3, 2, 1])\n",
"\n",
"with matplotlib.rc_context({'nbagg.transparent': False}):\n",
" plt.figure()\n",
"\n",
"plt.plot([3, 2, 1])\n",
"plt.show()"
]
},
Expand Down
2 changes: 0 additions & 2 deletions lib/matplotlib/mpl-data/stylelib/_classic_test.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,6 @@ savefig.transparent : False # setting that controls whether figures are saved
savefig.frameon : True
savefig.orientation : portrait

nbagg.transparent: True

# ps backend params
ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10
ps.useafm : False # use of afm fonts, results in small files
Expand Down
2 changes: 0 additions & 2 deletions lib/matplotlib/mpl-data/stylelib/classic.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,6 @@ savefig.transparent : False # setting that controls whether figures are saved
savefig.frameon : True
savefig.orientation : portrait

nbagg.transparent: True

# ps backend params
ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10
ps.useafm : False # use of afm fonts, results in small files
Expand Down
4 changes: 0 additions & 4 deletions matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ backend : $TEMPLATE_BACKEND
# When True, open the webbrowser to the plot that is shown
# webagg.open_in_browser : True

# When True, the figures rendered in the nbagg backend are created with
# a transparent background.
# nbagg.transparent : False

# if you are running pyplot inside a GUI and your backend choice
# conflicts, we will automatically try to find a compatible one for
# you if backend_fallback is True
Expand Down