meshc surfc do not display contour plot below the density for a Bivariate Gaussian
1 view (last 30 days)
Show older comments
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 Comment
Image Analyst
on 13 Jun 2014
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.
Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!