meshc surfc do not display contour plot below the density for a Bivariate Gaussian
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Image Analyst
le 13 Juin 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.
Réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!