diff --git a/doc/api/api_changes/2017-12-15-AL.rst b/doc/api/api_changes/2017-12-15-AL.rst new file mode 100644 index 000000000000..eb317c0a5de2 --- /dev/null +++ b/doc/api/api_changes/2017-12-15-AL.rst @@ -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. diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 846c08d1c32f..8340cdb061b4 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -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'} @@ -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.") diff --git a/lib/matplotlib/backends/web_backend/nbagg_uat.ipynb b/lib/matplotlib/backends/web_backend/nbagg_uat.ipynb index dedefb2d540f..83e8235d187b 100644 --- a/lib/matplotlib/backends/web_backend/nbagg_uat.ipynb +++ b/lib/matplotlib/backends/web_backend/nbagg_uat.ipynb @@ -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." ] }, { @@ -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()" ] }, diff --git a/lib/matplotlib/mpl-data/stylelib/_classic_test.mplstyle b/lib/matplotlib/mpl-data/stylelib/_classic_test.mplstyle index 2afebaa318a6..fc918feb953b 100644 --- a/lib/matplotlib/mpl-data/stylelib/_classic_test.mplstyle +++ b/lib/matplotlib/mpl-data/stylelib/_classic_test.mplstyle @@ -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 diff --git a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle index 663d6de2cecf..ac48c0a66e56 100644 --- a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle +++ b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle @@ -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 diff --git a/matplotlibrc.template b/matplotlibrc.template index 22fb2cfef5a1..45c07e19a5ee 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -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