Created
February 12, 2020 22:13
-
-
Save charlesfrye/47453ea3df7391f93c8bd8da318d5184 to your computer and use it in GitHub Desktop.
Testing interactive widgets for plotting in JupyterLab - copy contents into notebook files and run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ipywidgets | |
ipywidgets.IntSlider() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ipywidgets | |
from ipywidgets import interact | |
import matplotlib.pyplot as plt | |
### CELL NECESSARY BREAK HERE | |
%matplotlib widget | |
f, ax = plt.subplots() | |
@interact | |
def f(m=1): | |
ax.plot([0, m]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Testing Interactive Figures in JupyterLab
These two files contain code for checking whether the libraries and extensions needed to make interactive plots in JupyterLab are installed properly.
Once placed into notebooks and executed, intended results are screenshotted below.
For
test_interact
:IF YOU JUST SEE A TEXT OUTPUT INSTEAD OF A SLIDER, WIDGETS ARE NOT INSTALLED PROPERLY
For
test_interact_fig
:IF YOU SEE A NON-INTERACTIVE PLOT, IPYMPL AND INTERACTIVE PLOTS ARE NOT INSTALLED PROPERLY