I would like to interactively plot in jupyter notebook. While using matplotlib.pyplot and trying to plot interactively through the code below, I get the error Javascript Error: IPython is not defined.
import matplotlib.pyplot as plt
%matplotlib notebook
plt.figure()
plt.plot(x, y)
plt.show()
This error has appeared after I updated the anaconda. I have searched in the internet for a solution, but could not solve the issue in a cleaner way.
The notebook backend does not work in jupyter-lab (i.e. the problem is your line %matplotlib notebook which specifies the "notebook" backend for matplotlib)... You have to switch to ipympl for interactive plots for jupyter-lab or for jupyter notebook v7!
First install it, e.g.
pip install ipympl
then you can activate it with
%matplotlib widget
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With