Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotly + iPython Notebook - Plots Disappear on Reopen

When I create a notebook with plotly plots, save and reopen the notebook, the plots fail to render upon reopening - there are just blank blocks where the plots should be. Is this expected behavior? If not, is there a known fix?

like image 226
econgineer Avatar asked Aug 31 '16 18:08

econgineer


1 Answers

Check to make sure your notebook is marked as "trusted", either in the top-right corner of the notebook, or in the File menu.

My notebooks are trusted by default, but I managed to reproduce your observed behaviour by temporarily removing my ~/Library/Jupyter/nbsignatures.db file, which forces Jupyter to run the notebook as untrusted. Clicking the tile in the top-right corner to trust the notebook fixed the issue for me.

This page in the jupyter docs, Security in notebook documents explains further:

The security problem we need to solve is that no code should execute just because a user has opened a notebook that they did not write. Like any other program, once a user decides to execute code in a notebook, it is considered trusted, and should be allowed to do anything.

like image 158
Geoff Avatar answered Oct 07 '22 12:10

Geoff