基于matplotlib的数据可视化 - 三维曲面图gca

1 语法

ax = plt.gca(projection='3d')
ax.plot_surface(x,y,z,rstride=行步距,cstride=列步距,cmap=颜色映射)


gca(**kwargs)

在当前图像上,获取与给定关键字args匹配的当前Axes的当前Axes实例,若不存在,则会返回一个新创建的实例。

帮助文档中的一个示例

plt.gca(projection='polar')

If the current axes doesn't exist, or isn't a polar one, the appropriate
axes will be created and then returned.


plot_surface(X, Y, Z, *args, **kwargs)

Create a surface plot. 在默认情况下,它将以纯色的阴影着色,不过可以通过提供* cmap *参数来支持颜色映射。

猜你喜欢

转载自www.cnblogs.com/gengyi/p/9471835.html