jupyterlab interactive plot

后端 未结 5 1547
Happy的楠姐
Happy的楠姐 2020-11-29 18:33

I\'m getting into using Jupyterlab from Jupyter notebooks. In notebooks I used to use:

import matplotlib.pyplot as plt
%matplotlib notebook
plt.figure()
x =          


        
5条回答
  •  一整个雨季
    2020-11-29 18:52

    This solution works in jupyterlab

    import numpy as np
    import matplotlib.pyplot as plt
    from IPython.display import clear_output
    
    
    n = 10
    a = np.zeros((n, n))
    plt.figure()
    
    for i in range(n):
        plt.imshow(a)
        plt.show()
        a[i, i] = 1
        clear_output(wait=True)
    

提交回复
热议问题