1
극좌표의 점 격자에 위치한 스칼라 값을가집니다. 세타 및 파이 각도를 자유롭게 선택할 수 있지만 r 값은 데이터 평가의 또 다른 단계에서 제공됩니다. isosurface를 플롯하고 mayavi를 사용하여 데이터를 잘라내는 방법은 무엇입니까?불규칙한 간격의 Mayavi로 등고 면면을 그려야합니다.
from scipy import *
from enthought.mayavi import mlab
r_val = [0.5, 1.0, 1.5, 2.0] # externally given
r, theta, phi = mgrid[ \
r_val[0]:r_val[-1]:len(r_val)*1.j, \
0:pi:len(r_val)*1.j, \
0:2.*pi:len(r_val)*1.j ]
x = r*sin(theta)*cos(phi)
y = r*sin(theta)*sin(phi)
z = r*cos(theta)
# here would be the data
s = ones_like(x)
s *= r*r
# the x,y,z axes of this plot are r,theta,phi
mlab.contour3d(s)
# but I want them to be x,y,z!
# this does not work
#mlab.contour3d(x,y,z,s)