title: matplotlib widget disappears after first use
body: <p>I'm trying once more to use interactive matplotlib plots in Jupyter Notebooks for my students. My plan is to use JupyterLab as the plain Notebook interface is not very well liked among students. Here is a two-cell MWE notebook:</p>
  <pre><code>import numpy as np
  %matplotlib widget
  import matplotlib.pyplot as plt
  </code></pre>
  <p>Next cell:</p>
  <pre><code>plt.figure(1)
  x = np.arange(100)
  y = x*x
  plt.plot(x,y)
  plt.show()
  </code></pre>
  <p>When I run these cells I do get an interactive Matplotlib plot. But when I run the second cell a second time, the plot window vanishes without a warning or error and only comes back when I rerun the first cell before the second cell. The classic notebook interface shows the same behaviour, dropping <code>plt.show()</code> or <code>plt.figure()</code> also makes no difference.</p>
  <p>I'm running the Jupyter Server locally on a Windows 10 machine in a <code>venv</code> environment, the following versions are installed:</p>
  <pre><code>Python           : 3.8.2
  ipympl           : 0.7.0
  
  jupyter core     : 4.7.1
  jupyter-notebook : 6.3.0
  qtconsole        : not installed
  ipython          : 7.23.1
  ipykernel        : 5.5.4
  jupyter client   : 6.1.12
  jupyter lab      : 3.0.14
  nbconvert        : 6.0.7
  ipywidgets       : 7.6.3
  nbformat         : 5.1.3
  traitlets        : 5.0.5
  </code></pre>
  <p>To my non-expert eyes the messages during startup seem to be ok:</p>
  <pre><code>[I 2021-05-12 10:10:48.065 LabApp] JupyterLab extension loaded from d:\envs\pyfda_38\lib\site-packages\jupyterlab
  [I 2021-05-12 10:10:48.065 LabApp] JupyterLab application directory is D:\envs\pyfda_38\share\jupyter\lab
  [I 2021-05-12 10:10:48.069 ServerApp] jupyterlab | extension was successfully loaded.
  [I 2021-05-12 10:10:48.488 ServerApp] nbclassic | extension was successfully loaded.
  [I 2021-05-12 10:10:48.489 ServerApp] Serving notebooks from local directory: D:\Daten\xxx
  [I 2021-05-12 10:10:48.489 ServerApp] Jupyter Server 1.6.4 is running at:
  [I 2021-05-12 10:10:48.489 ServerApp] http://localhost:8888/lab?token=xxxx
  </code></pre>
  <p>The only (maybe) relevant warning I get is</p>
  <pre><code>[W 2021-05-12 10:10:55.256 LabApp] Could not determine jupyterlab build status without nodejs 
  </code></pre>
  <p>Am I doing something wrong or are interactive plots with ipympl not yet mature enough for a BYOD course?</p>