1. 程式人生 > >基於matplotlib的數據可視化 - 三維曲面圖gca

基於matplotlib的數據可視化 - 三維曲面圖gca

iat then 一個 rst plt 示例 surf plot 情況

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 *參數來支持顏色映射。

基於matplotlib的數據可視化 - 三維曲面圖gca