Plotting values with colormap of xy-plane?
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sharif Khalil
le 23 Juil 2018
Commenté : Sharif Khalil
le 24 Juil 2018
I have used countourf(X,Y,Z); I have X, Y, Z are (11X300) matrix; I need to plot values of Z with different colors on a x-y plane. note that X is originally a vector(1X300) and Y is (1X11), by meshgrid it was turned into the same size of Z. I do not know how to plot Z values on the x-y plane with different colors.
2 commentaires
Réponse acceptée
Walter Roberson
le 24 Juil 2018
pcolor(X, Y, Z) is the same as surf(X, Y, Z, 'edgecolor', 'none') followed by view(90)
If your X and Y are consecutive integers starting from 1, then you could just
pcolor(Z)
Note that when you pcolor or surf, that the number of output "pixels" is one fewer in each direction than the number of rows or columns. surf determines the color of each pixel by interpolation from the four corner vertices.
If your X and Y are linear and equidistant, you could consider using
imagesc(X, Y, Z)
Plus de 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!