[Python] JupyterLab interactive plot

Discussão em 'Python' iniciado por Stack, Março 15, 2025.

  1. Stack

    Stack Membro Participativo

    With old Jupyter notebooks, I could create interactive plots via:

    import matplotlib.pyplot as plt
    %matplotlib notebook
    x = [1,2,3]
    y = [4,5,6]
    plt.figure()
    plt.plot(x,y)


    However, in JupyterLab, this gives an error:

    JavaScript output is disabled in JupyterLab


    I have also tried the magic (with jupyter-matplotlib installed):

    %matplotlib ipympl


    But that just returns:

    FigureCanvasNbAgg()


    Inline plots work, but they are not interactive plots:

    %matplotlib inline

    Continue reading...

Compartilhe esta Página