Adapt my colorbar to a specific value

20 ビュー (過去 30 日間)
Gaétan Andriano
Gaétan Andriano 2022 年 12 月 13 日
回答済み: Gaétan Andriano 2022 年 12 月 16 日
Here is an example of a figure that you can find in the matlab help with the colorbar function.
My interrogation is very simple. I would like to set a specific color at a specific value on the colorbar. For instance, I would like to have cyan at 4 rather than 0. I don't just want to replace the color there, the goal is to adapt the rest of my colorbar to that value. In my example, I would like the blue shades to be between -6 and 4 and the rest of the colors to be between 4 and 8.
Anyone can help me please ?

採用された回答

Gaétan Andriano
Gaétan Andriano 2022 年 12 月 16 日

その他の回答 (1 件)

Jiri Hajek
Jiri Hajek 2022 年 12 月 14 日
Seems like you need to focus on colormap, that's the function which defines your color scale. Or maybe just change the scale for your plot, that way you may be able to shift the color levels, if that's sufficient for you.
  5 件のコメント
Jiri Hajek
Jiri Hajek 2022 年 12 月 14 日
And what about keeping the whole colorscale fixed at such values, so that zero would be at yellow? In my eyes, that would be the best thing for comparability and generality of the solution - and simplicity, to be sure.
Gaétan Andriano
Gaétan Andriano 2022 年 12 月 16 日
Thanks for your help and I hope this link could help other users of Matlab

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by