Any easy way to plot a 3d scatter in Python that I can rotate around?

后端 未结 2 790
野趣味
野趣味 2020-12-13 05:33

Currently I\'m using matplotlib to plot a 3d scatter and while it gets the job done, I can\'t seem to find a way to rotate it to see my data better.

Here\'s an examp

2条回答
  •  佛祖请我去吃肉
    2020-12-13 05:58

    Using mayavi, you can create such a plot with

    import enthought.mayavi.mlab as mylab
    import numpy as np
    x, y, z, value = np.random.random((4, 40))
    mylab.points3d(x, y, z, value)
    mylab.show()
    

    The GUI allows rotation via clicking-and-dragging, and zooming in/out via right-clicking-and-dragging.

    alt text

提交回复
热议问题