Contourf colour doesn't display correct values.

19 vues (au cours des 30 derniers jours)
mathman
mathman le 1 Jan 2018
Commenté : mathman le 1 Jan 2018
I have a contourf plot shown below, the problem I'm having is that the ring is supposed to be almost white; the values in the matrix I'm plotting are all between 50 and 60. Where as the current corresponding colour is seemingly between -50 and -60. I've plotted it using the following code:
contourf(x_axis, y_axis,P_INDEX)
colormap(hot)
colorbar
caxis([-60 60])
I've also tried plotting it using abs(P_INDEX) but it gives the same output. Does anyone know what the issue could be?

Réponse acceptée

ANKUR KUMAR
ANKUR KUMAR le 1 Jan 2018
I have tried to plot the similar contour using your program and I am getting the correct contour.
P=randi(60,20,30);
P(P<50)=52;
contourf(P)
colormap(hot)
colorbar
caxis([-60 60])
I think, there might be some mistake in P_INDEX values. I request you to cross check (manually) the P_INDEX values. This could be the error..
If your problem is not resolved yet, then please attach the .mat file which contains P_INDEX, y_axis and x_axis.
  6 commentaires
ANKUR KUMAR
ANKUR KUMAR le 1 Jan 2018
Plot this one and see the graph.
contourf(P_INDEX(150:155,280:300))
mathman
mathman le 1 Jan 2018
Oh I see what you mean. Thanks for the help.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by