2016-09-11 3 views
1

는 I는 다음과 같은 플롯을 할 x, y 데이터는 W으로 표시되고 xy 평면에서의 투영도 표시됩니다. Wigner 함수를 그려주는 다음 코드를 사용했습니다. 동일한 플롯에서 xy 평면에 W의 투영을 표시하는 방법은 무엇입니까?

xvec = [-2:2]; 
yvec = xvec; 
W = wfunc(psi,xvec,yvec,g); 
f1 = figure(1); 
mesh(xvec,yvec,real(W)); 
shading interp 

답변

0

동일한 그림에 많은 그래픽 객체를 추가 할 hold on을 사용할 수 있습니다. 예를 들어 :

figure  
surf(xvec,yvec,real(W),'linestyle','none') 
hold on 
contourf(xvec,yvec,real(W),100,'linestyle','none') 

당신은

[~,hc] = contourf(xvec,yvec,real(W),100,'linestyle','none'); 
hcpatches = findobj(hc,'Type','Patch'); 
for n=1:length(hcpatches) 
    set(hcpatches(n),'ZData',-5*ones(size(get(hcpatches(n),'XData')))) 
end 

또한 사용 (주석 here에 다음과 같은) 윤곽 색상 맵의 z α 위치를 이동할 수 있습니다, 당신은 surfc를 사용하려고 할 수 있습니다.