我有下面的代码产生的表面情节,但它不会做我期望的。Matplotlib表面图不直观的三角测量
xx, yy = np.meshgrid(dealer_sums, player_sums)
def getter(dealer_sum, player_sum):
state = (dealer_sum, player_sum)
return self.get_value(state)
z = np.vectorize(getter)
zz = z(xx,yy)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_wireframe(xx,yy, zz)
仅供参考,xx,yy和zz的形状全部相等且为2D。
通过观察这个其他职位(surface plots in matplotlib; Simplest way to plot 3d surface given 3d points),它看起来像一个共同的问题是,X和Y坐标是不规则的,但如果我理解正确的话,我认为我是通过调用np.meshgrid
已经转正?
,这就是调用plot_wireframe
样子:
我画了几本我没有想到的线条。我的问题是,是否有可能摆脱这些线条,并创建一个看起来像这样的表面?
感谢您的帮助。
这是排序的伎俩 - 非常感谢你! –