Python & Matplotlib: Make 3D plot interactive in Jupyter Notebook

后端 未结 6 1210
臣服心动
臣服心动 2020-12-22 18:22

I use Jupyter Notebook to make analysis of datasets. There are a lot of plots in the notebook, and some of them are 3d plots.

I\'m wondering if it is possible

6条回答
  •  庸人自扰
    2020-12-22 18:56

    try:

    %matplotlib notebook

    see jakevdp reply here

    EDIT for JupyterLab users:

    Follow the instructions to install jupyter-matplotlib

    Then the magic command above is no longer needed, as in the example:

    # Enabling the `widget` backend.
    # This requires jupyter-matplotlib a.k.a. ipympl.
    # ipympl can be install via pip or conda.
    %matplotlib widget
    # aka import ipympl
    
    import matplotlib.pyplot as plt
    
    plt.plot([0, 1, 2, 2])
    plt.show()
    

    Finally, note Maarten Breddels' reply; IMHO ipyvolume is indeed very impressive (and useful!).

提交回复
热议问题