meshc surfc do not display contour plot below the density for a Bivariate Gaussian
2 次查看(过去 30 天)
显示 更早的评论
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');
1 个评论
Image Analyst
2014-6-13
Read this http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup. Then reattach your image/diagram - it didn't come through.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!