meshc surfc do not display contour plot below the density for a Bivariate Gaussian

조회 수: 2 (최근 30일)
Lei Fang
Lei Fang 2014년 6월 13일
편집: Lei Fang 2014년 6월 13일
Hi there,
I used the following code to generate a surface plot of a Gaussian. I want to display the contour below the surface plot so I tried surfc and meshc. However, the density shows fine but the contour has never displayed. The plot is attached. Thank you for your time.
mu = [18.36229 39.01951];
Sigma = [0.22922847 -0.04663909; -0.04663909 0.01395780];
x1 = 16.44:.02:20.28; x2 = 38:.02:40;
[X1,X2] = meshgrid(x1,x2);
F = mvnpdf([X1(:) X2(:)],mu,Sigma);
F = reshape(F,length(x2),length(x1));
surfc(x1,x2,F);
% meshc(x1,x2,F);
%caxis([min(F(:))-.5*range(F(:)),max(F(:))]);
axis([16.44 20.28 38 40 0 5.0])
xlabel('T'); ylabel('H'); zlabel('Probability Density');

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by