배경
the documentation example here에서 코드 스 니펫으로 다음 등고선 플롯을 쉽게 생성 할 수 있습니다.matplotlib의 윤곽선에서 좌표를 가져 옵니까?
import matplotlib
import numpy as np
import matplotlib.cm as cm
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
matplotlib.rcParams['xtick.direction'] = 'out'
matplotlib.rcParams['ytick.direction'] = 'out'
delta = 0.025
x = np.arange(-3.0, 3.0, delta)
y = np.arange(-2.0, 2.0, delta)
X, Y = np.meshgrid(x, y)
Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
# difference of Gaussians
Z = 10.0 * (Z2 - Z1)
# Create a simple contour plot with labels using default colors. The
# inline argument to clabel will control whether the labels are draw
# over the line segments of the contour, removing the lines beneath
# the label
plt.figure()
CS = plt.contour(X, Y, Z)
plt.clabel(CS, inline=1, fontsize=10)
plt.title('Simplest default with labels')
내 목표
내 윤곽 플롯을 얻은 한편 matplotlib.contour.QuadContourSet
예를 CS
을 가지고있다. 예제 스 니펫에서 CS
은 clabel()
에만 사용됩니다. 그러나 제 경우에는 등고선의 방정식이나 차후 계산을위한 좌표 세트 중 하나를 얻어야합니다.
CS
인스턴스에서 등고선 좌표를 추출하려면 어떻게해야합니까? 또는 다른 방법으로 어떻게 구현할 수 있습니까?
내가 그렇게 할 방법이 틀림 없음. 그렇지 않으면 윤곽선은 "시각화를위한 화병"일뿐입니다.
http://scikit-image.org/docs/dev/auto_examples/plot_contours.html – tacaswell