tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Plot disappears when a cell runs a second time

Open jklynch opened this issue 6 years ago • 3 comments

We are seeing a problem in jupyterlab when a cell that creates a plot runs once the plot is generated file, when run a second time the plot disappears.

for example the 7th cell in Hello Bluesky.ipynb

jklynch avatar Jul 18 '19 19:07 jklynch

On the first run:

Screenshot_2019-07-18 JupyterLab

On the second run of the same cell:

Screenshot_2019-07-18 JupyterLab2

mrakitin avatar Jul 18 '19 19:07 mrakitin

This is an unfortunate issue with the notebook cell-based display model. The figure gets put in the cell as a js widget when it is created and shown. The second time through we add things to the same figure, but replace output cell and replace it. Thus the Figure is still alive and will take new data, but it is no longer in a output cell on the screen.

tacaswell avatar Jul 26 '19 15:07 tacaswell

Our approach for fixing this is to create the figure in a dedicated cell, above where RE(...) is called. We have applied this fix to "Hello Bluesky.ipynb" and some others but more remain to be done.

danielballan avatar May 13 '20 19:05 danielballan