當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python matplotlib Axes3D.plot_trisurf用法及代碼示例

本文簡要介紹 python 語言中 mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf 的用法。

用法

Axes3D.plot_trisurf(*args, color=None, norm=None, vmin=None, vmax=None, lightsource=None, **kwargs)

繪製三角曲麵。

(可選)三角剖分可以通過以下兩種方式之一指定;任何一個:

plot_trisurf(triangulation, ...)

其中三角測量是一個 Triangulation 對象,或者:

plot_trisurf(X, Y, ...)
plot_trisurf(X, Y, triangles, ...)
plot_trisurf(X, Y, triangles=triangles, ...)

在這種情況下,將創建三角測量對象。有關這些可能性的解釋,請參閱 Triangulation

剩下的論點是:

plot_trisurf(..., Z)

其中Z 是輪廓值的數組,三角剖分中的每個點一個。

參數
X, Y, Z 類數組

數據值作為一維數組。

color

表麵補丁的顏色。

cmap

表麵補丁的顏色圖。

norm 標準化

將值映射到顏色的 Normalize 實例。

vmin, vmax 浮點數,默認:無

要映射的最小值和最大值。

shade 布爾值,默認值:真

是否對 facecolors 進行著色。指定 cmap 時,始終禁用著色。

lightsource LightSource

shade 為 True 時使用的光源。

**kwargs

所有其他關鍵字參數都傳遞給 Poly3DCollection

例子

( Source code 2x.png png )

( Source code 2x.png png )

相關用法


注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。