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
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');