gpt4 book ai didi

python - 用于 3D 散点图的 Matplotlib 替代品

转载 作者:太空宇宙 更新时间:2023-11-03 15:06:51 24 4
gpt4 key购买 nike

在应用主成分分析或线性判别分析后,我很难使用 Matplotlib 在 3 个维度上可视化我的数据的重投影结果。绘制散点图后,我无法在轻松缩放时旋转数据或更改视角(旋转轴即使在缩放后也保持不变,如果缩放太多点就会消失)并且每次更改都需要一秒钟才能发生。 Matplotlib 非常有用,但对于这个特定的用例,它开始变得非常令人沮丧,因为它可能不是为此类任务而设计的。在 Python 中是否有 Matplotlib 的替代品可以更好地处理 3d 散点图并且可以在云中流畅地导航?

下图显示了一个示例。我在对应于特定类的每个数据集群周围绘制了球体,并用红色对重叠球体进行了着色。现在我想看看这些球体是如何相交的。我认为 Matplotlib 最大的问题是它不允许用鼠标移动整个图形,它只允许围绕一个固定点旋转,一旦放大一点就会变得非常困惑。

enter image description here

最佳答案

matplotlib 对于 3d 图形还不是很成熟: http://matplotlib.org/mpl_toolkits/mplot3d/faq.html

mplot3d was intended to allow users to create simple 3D graphs with the same “look-and-feel” as matplotlib’s 2D plots. Furthermore, users can use the same toolkit that they are already familiar with to generate both their 2D and 3D plots.

我不认为在 3d 绘图中轻松导航是很容易实现的(如果不调整 lib,即使是 3d 缩放也是不可能的)。 mplot3d 一开始并不是真正打算成为一个成熟的 3D 图形库,但对于需要基本 3D 和熟悉 matplotlib 2D 绘图结构的人来说,这是一个很好的补充。

您可能想看看 MayaVI(非常好):

MayaVi2 is a very powerful and featureful 3D graphing library. For advanced 3D scenes and excellent rendering capabilities, it is highly recomended to use MayaVi2.

请注意,与 matplotlib 不同,MayaVI 尚不兼容 Python3(并且在可预见的 future 可能不兼容),因此您需要安装 Python2。

关于python - 用于 3D 散点图的 Matplotlib 替代品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31674039/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com