How can I create a correct contour plot with contourfm function?

1 visualizzazione (ultimi 30 giorni)
Dear All, I have a lot of matrices what about I want to create colourfm maps. The values of the matrices varied between 1 and 31. I tried to create a map about one of them which values are: 1,3,4,5,6,11,12,17,18,19,20,21,22,28,29,30 with the following way:
worldmap('Europe');
load coast;
plotm(lat, long, 'k');
clear lat long;
caxis([1 31]);
colormap(cmap(1:31,:));
colorbar;
contourfm(latitude,longitude,IU2,31);
I received the Fig 1. It is wrong because it shows the color value 2. Moreover in Scandinavia the value is dominantly 30 instead of 31.
I tried also the
worldmap('Europe');
load coast;
plotm(lat, long, 'k');
clear lat long;
caxis([1 31]);
colormap(cmap(1:31,:));
colorbar;
contourfm(latitude,longitude,IU2,30);
but it also shows wrong colour values (Fig 2) moreover the colours does not change between some contour.
Can someone suggest me a correct solution for this issue? Thank you for your help in advance!

Risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by