Home > Archive > Matlab > July 2006 > Contour colors do not agree with data
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Contour colors do not agree with data
|
|
| Francesco Papa 2006-07-31, 7:17 pm |
| Hello everyone,
I have defined a contour plot with a user defined colormap.
If I run my code using matlab2006a, the colors in some areas disagree
with the data in the matrix I am plotting.
If I use matlab14sp2, running the exact same code, this does not
occur and the contour plots are correct.
As a note, in the two cases the position of the countour lines that
separate a color from another is the same, it's just that using
matlab2006a the colors of some contour levels are wrong.
Has anyone experienced this problem before?
Thank you,
Francesco
| |
| NZTideMan 2006-07-31, 10:02 pm |
|
Francesco Papa wrote:
> Hello everyone,
>
> I have defined a contour plot with a user defined colormap.
> If I run my code using matlab2006a, the colors in some areas disagree
> with the data in the matrix I am plotting.
>
> If I use matlab14sp2, running the exact same code, this does not
> occur and the contour plots are correct.
> As a note, in the two cases the position of the countour lines that
> separate a color from another is the same, it's just that using
> matlab2006a the colors of some contour levels are wrong.
> Has anyone experienced this problem before?
>
> Thank you,
> Francesco
Oh yes indeed!!!
I've been caught by this BIG time...........
You need to add this at the bottom of your plotting code:
caxis([vp(1) vp(end)])
where vp is the set of contour levels. It locks the min and max
contours to the end points of the colour map.
|
|
|
|
|