I have searched a lot but I can not find my answer.I am new to matlab.
I want to show specific colors in color bar based on the values [0 1 2 3 4 5 10 15], in other words I want to reserve colors for these values...for example yellow color between 0 and 1, orange color between 1 and 2, red color between 2 and 3 and so on...I have used code below but It is not the right answer..the main data can be between 0 and 2 , 0 and 10, or 0 and 15..I want to have exactly a specific color for values between 0 and 1 in all of my figures...I have used contourf function.
here is my code:
points = [ 1 1 1 1; 2 2 2 2 ];
>
> depths = [ 10 5 1 0.5; 10 5 1 0.5];
>
> RFU27 = [1.46 0.32 0.26 0.26; 1.46 0.32 0.26 0.26];
>
> contourf(points,depths,RFU27)
>
> % Design the Plot
set(gca, 'XTick', points(1) : points(2),'XTickLabel',{ 'LSB1' , 'LSB2'});
>
> ylabel('Depth(m)') xlabel('Points') title('Date: 27.08.2013')
>
> set(get(colorbar('YTickLabel',...
> {'0','1','2','3',...
> '4','5','10','15'}),'ylabel'),'String','BGA PC(RFU)');
set(gca,'ydir','rev')
and here are some of the real data which I must use in contourf
RFU27 = [1.46 0.32 0.26 0.26; 1.46 0.32 0.26 0.26];
RFULast = [2.460869565, 0.539285714, 0.458208955, 0.566666667, 0; 0, 0, 0, 0, 14.27300469];
Please Help me, Thanks.