How to generate a non-linear colormap/colorbar?

前端 未结 4 1858
时光说笑
时光说笑 2020-11-30 13:02

I would like to show a non-uniform colorbar as in the first picture. I have tried the code below. \'mycamp4\' is a colormap manually saved. The result is shown as the second

4条回答
  •  孤街浪徒
    2020-11-30 13:30

    one can try Recolor_contourf. It has two more functions and easy to use. In its help the example given as follows. The function is submitted by me. let me know if face any issue

    X=1:10;Y=1:10;
    C=rand(10,10)*150;
    c=colormap(jet(7));
    L=[10 20 50 60 70 100];
    [cdd hc]=contourf(X,Y,C,[-5 L]);
    Recolor_contourf(hc,c,L,'vert');
    

提交回复
热议问题