【发布时间】:2016-05-28 22:11:44
【问题描述】:
如果我有一个 3D 点列表,请说
pts = [(0,0,0),(1,0,0),(0,2,0),(0,0,3)]
我想使用 SciPy 来绘制它们,我该怎么做?我试过了
plot3d([Point(0,0,0),Point(1,0,0),Point(0,2,0),Point(0,0,3)], (x, -5, 5), (y, -5, 5))
但这会导致此错误:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-54-851ee4534010> in <module>()
----> 1 plot3d([Point(0,0,0),Point(1,0,0),Point(0,2,0),Point(0,0,3)], (x, -5, 5), (y, -5, 5))
/usr/lib/python3.5/site-packages/sympy/plotting/plot.py in plot3d(*args, **kwargs)
1618 series = []
1619 plot_expr = check_arguments(args, 1, 2)
-> 1620 series = [SurfaceOver2DRangeSeries(*arg, **kwargs) for arg in plot_expr]
1621 plots = Plot(*series, **kwargs)
1622 if show:
TypeError: 'NoneType' object is not iterable
理想情况下,该解决方案将绘制具有这些顶点的多面体(四面体),或将它们与线段连接。
【问题讨论】:
标签: python matplotlib scipy ipython