MATLAB - 3D轮廓图(氢2p轨道)

时间:2011-11-07 17:35:04

标签: matlab 3d plot contour

我有以下代码可用于绘制氢气2pz轨道的x-y切片:

%probability densities
pd_psi_210 = @(r,theta,phi) exp(-r).*(r.^2).*(cos(theta).^2)/(32*pi);

%configuring the range
[x y z] = meshgrid(-10:.1:10,-10:.1:10,-2:.1:2);
[THETA,PHI,R] = cart2sph(x,y,z);

%create array of probability density magnitudes
psi_210_vals = pd_psi_210(R,THETA,PHI);

%plotting
imagesc(psi_210_vals(:,:,1)); %x-y plane

我想绘制轨道的三维等高线图。我试过这个(它似乎没有得到我想要的东西):

isosurface(psi_210_vals(:,:,:)); %3D contour

我怎样才能让它发挥作用?

1 个答案:

答案 0 :(得分:6)

您只需指定基础网格和所需级别。例如:

>> isosurface(-10:.1:10, -10:.1:10, -2:.1:2, psi_210_vals, 0.001);
>> axis equal

enter image description here