ipympl: ipympl causes matplotlib deprecation warning

Every plot currently issues a MPL deprecation warning:

/Users/klay6683/miniconda3/envs/stable/lib/python3.6/site-packages/matplotlib/__init__.py:932: MatplotlibDeprecationWarning: nbagg.transparent is deprecated and ignored. Use figure.facecolor instead.
  mplDeprecation)

How can we fix this? Versions: MPL: 2.2.0, ipympl 0.1.0 (both via conda-forge) I only get the warning AFTER I activate the ipympl backend.

On the other note, seeing that not much is happening at this repo, is this really the official backend for doing dynamic plots in notebooks and j-lab now?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 20 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I was running into this issue as well and found it interesting that even checking to see if the key is in rcParams throws the warning. A quick fix that will at least remove the warning if you don’t even have that key in rcParams is to check against a set of the keys rather than the keys themselves:

if 'nbagg.transparent' in set(rcParams.keys()) and rcParams['nbagg.transparent']:

https://github.com/matplotlib/jupyter-matplotlib/blob/0f1e870c1ee3583767759fa1134fff429767ac6a/ipympl/backend_nbagg.py#L240-L241