2
我已经搜索了很多,但我找不到我的答案。我是matlab新手。自定义颜色条的颜色MATLAB
我想基于值[0 1 2 3 4 5 10 15]在颜色栏中显示特定的颜色,换句话说,我想为这些值保留颜色...例如0和1之间的黄色,在1和2之间的橙色,在2和3之间的红色等...我已经使用了下面的代码,但它不是正确的答案..主要数据可以在0和2之间,0和10或0和15 ..我想在我的所有数字中为0和1之间的值完全确定一个特定的颜色...我已经使用contourf函数。 这里是我的代码:
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')
这里有一些我必须在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];
请帮助我,谢谢真实数据。
此早期的线程可能会回答你的问题:http://stackoverflow.com/questions/17230837/how-to-create-a-custom -colormap-programatically – Cici
你有没有考虑[colormapeditor](http://www.mathworks.es/es/help/matlab/ref/colormapeditor.html)? – thewaywewalk
不...谢谢,我会尝试。 – Parid0kht