itsaMeMathi0x
itsaMeMathi0x

Reputation: 172

How to run an animated plot inline with Jupyter Lab?

Running my animated plot in a jupyter notebook is OK. Now trying the same code in Jupyter Lab does not work. I've read a lot of similar situations, tried every solution given, but my plot stays static. No animation running.

This is my extension list, installed and enabled ('jupyter lab build'):

$ jupyter labextension list
JupyterLab v0.35.4
Known labextensions:
   app dir: /home/teleuff/anaconda3/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v0.38.1  enabled  OK
        @jupyterlab/plotly-extension v1.0.0  enabled  OK
        jupyter-matplotlib v0.3.0  enabled  OK
        plotlywidget v1.1.0  enabled  OK

%matplotlib inline does not raise JavaScript error, but my plot is not animated.

%matplotlib widget and %pylab inline also have the same effect, only difference is the output line:

Populating the interactive namespace from numpy and matplotlib

Any ideas?

Thanks in advance!

Upvotes: 0

Views: 1537

Answers (1)

Gray
Gray

Reputation: 1388

Find and click the little shield on the table frame at the bottom of the screen. Is this shield icon displaying a check mark inside the shield? Hover the mouse above the shield, does the shield then display a message:

{ Active Cell Trusted: x of y shields trusted }

It's likely there is no check mark inside the shield. The reason is the Jupyter extension is designed to be locked down.

Review the Jupyter-notebook security page: Jupyter-notebook

Overview from the security page:

  • Untrusted HTML is always sanitized
  • Untrusted JavaScript is never executed
  • Html and JavaScript in Markdown cells are never trusted
  • Outputs generated by the user are trusted
  • Any other HTML or JavaScript (in Markdown cells, output generated by owners) is never trusted

The bottom line and central question of trust is: Did the current user do this? I've found Jupyter Lab security settings make bullet-number 3 the overriding rule.

Upvotes: 1

Related Questions