Setting range for each color in the colorscale

1 次查看(过去 30 天)
Hi,
I have a plot like the attached. I used the following code to get this:
contourf(x,y,chg, 'edgecolor','none');
colorbar;
colormap(jet);
I want to divide the colorscale by seven colors and each color will have different range which is not linear. Such as:
1st color range: -2.5*10^0 to -10^0
2nd color range: -10^0+0.0001 to -10^-1
3rd color range: -10^-1+0.0001 to -10^-2
4th color range: -10^-2+0.0001 to 10^-2
5th color range: 10^-2+0.0001 to 10^-1
6th color range: 10^-1+0.0001 to 10^-0
7th color range: 10^-0+0.0001 to 2.5*10^-0
Can anyone help me with it? Thanks!CHGCAR_plot.jpg

回答(1 个)

Walter Roberson
Walter Roberson 2019-7-22

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by