표면을 정의하는 노드가있는 경우 불규칙한 좌표계와 해당 값의 격자가 있음을 의미합니다. 따라서 삼각 측량을 생성 할 수 있습니다 (이 채워진 등고선을 표시하는 데 가장 많이 사용하는 도구는 화면 뒤에서도 동일하게 사용합니다).
Matplotlib에는 및 CubicTriInterpolator과 같이 삼각형을 rectilinear grid (더 일반적인 형태의 사각형 모눈)으로 변환 할 수있는 두 개의 매우 유용한 클래스가 있습니다. 그들은 this matplotlib example에서 사용되고 있습니다.
이 나 주석이 같은 예에서 기본 단계가 있지만 신용은하기 matplotlib 참여자로 이동 :
import matplotlib.pyplot as plt
import matplotlib.tri as mtri
import numpy as np
# Create triangulation.
coords, earthquake_fault = get_coordinate_data() # to be filled in by you
x = coords['x']
y = coords['y']
triang = mtri.Triangulation(x, y)
# Interpolate to regularly-spaced quad grid.
z = earthquake_fault # the "height" data
xi, yi = np.meshgrid(np.linspace(x.min(), x.max() 20), np.linspace(y.min(), y.max(), 20))
interp_lin = mtri.LinearTriInterpolator(triang, z)
zi_lin = interp_lin(xi, yi)
# Plot the triangulation.
plt.subplot(121)
plt.tricontourf(triang, z)
plt.triplot(triang, 'ko-')
plt.title('Triangular grid')
# Plot linear interpolation to quad grid.
plt.subplot(122)
plt.contourf(xi, yi, zi_lin)
plt.title('Rectangular grid')