From: Makarand on
I am using matlab 2010. I want to draw a colorbar on contourf plot but the contourf colors and colorbar colors are not matching
The example code looks like this
clear; clc;close all;
X=1:10;Y=1:10;
C=rand(10,10)*100;
colormap(jet(7));
[c1 h1]=contourf(X,Y,C,fliplr([0 10 20 50 60 70 100]));
clabel(c1,h1);
colorbar

I want to say if the values 20-50 fall in one category then why 20-30 30-40 is displayed on the colorbar
please help in this problem
From: Makarand on
I think no body could understand my problem
I shall make it more brief please answer it.
I modify the code like this
clear; clc;close all;
X=1:10;Y=1:10;
C=rand(10,10)*100;
colormap(jet(7));
[c1 h1]=contourf(X,Y,C,fliplr([0 10 20 50 60 70]));
clabel(c1,h1);
hold on
pcolor(X,Y,C);
colorbar

See the Pcolr values are not matching with the matrix C why is so?
any help please
From: Makarand on
"Makarand " <makarand_kulkarni(a)hotmail.com> wrote in message <ht0fg3$li7$1(a)fred.mathworks.com>...
> I am using matlab 2010. I want to draw a colorbar on contourf plot but the contourf colors and colorbar colors are not matching
> The example code looks like this
> clear; clc;close all;
> X=1:10;Y=1:10;
> C=rand(10,10)*100;
> colormap(jet(7));
> [c1 h1]=contourf(X,Y,C,fliplr([0 10 20 50 60 70 100]));
> clabel(c1,h1);
> colorbar
>
> I want to say if the values 20-50 fall in one category then why 20-30 30-40 is displayed on the colorbar
> please help in this problem

Kindly check little modified code
clear; clc;close all;
X=1:10;Y=1:10;
C=rand(10,10)*100;
colormap(jet(7));
[c1 h1]=contourf(X,Y,C,fliplr([0 10 20 50 60 70]));
clabel(c1,h1);
hold on
pcolor(X,Y,C);
colorbar

see the values in the matrix C doesn't agree with the color scale what to do for that
please help me
From: mat001 on
"Makarand " <makarand_kulkarni(a)hotmail.com> wrote in message <ht0fg3$li7$1(a)fred.mathworks.com>...
> I am using matlab 2010. I want to draw a colorbar on contourf plot but the contourf colors and colorbar colors are not matching
> The example code looks like this
> clear; clc;close all;
> X=1:10;Y=1:10;
> C=rand(10,10)*100;
> colormap(jet(7));
> [c1 h1]=contourf(X,Y,C,fliplr([0 10 20 50 60 70 100]));
> clabel(c1,h1);
> colorbar
>
> I want to say if the values 20-50 fall in one category then why 20-30 30-40 is displayed on the colorbar
> please help in this problem

I do not understand your problem but
It seems your problem is colorbar.

why not you set the colorbar.
From: Makarand on
"mat001 " <priya.biomath(a)yahoo.co.in> wrote in message <ht0re2$pon$1(a)fred.mathworks.com>...
> "Makarand " <makarand_kulkarni(a)hotmail.com> wrote in message <ht0fg3$li7$1(a)fred.mathworks.com>...
> > I am using matlab 2010. I want to draw a colorbar on contourf plot but the contourf colors and colorbar colors are not matching
> > The example code looks like this
> > clear; clc;close all;
> > X=1:10;Y=1:10;
> > C=rand(10,10)*100;
> > colormap(jet(7));
> > [c1 h1]=contourf(X,Y,C,fliplr([0 10 20 50 60 70 100]));
> > clabel(c1,h1);
> > colorbar
> >
> > I want to say if the values 20-50 fall in one category then why 20-30 30-40 is displayed on the colorbar
> > please help in this problem
>
> I do not understand your problem but
> It seems your problem is colorbar.
>
> why not you set the colorbar.

hi ,
Thanks for the reply
Will you please tell me how to do that?
Because you see we have 7 categories of contour and 7 colors, but some colors remain unused. and some have been used twice. so how to handle this problem.
thanks again