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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by