Reverse/flip values in the colorbar axis
109 ビュー (過去 30 日間)
古いコメントを表示
Hi,
In the attached figure, I have reverse the values in the color bar i.e. red to be positive and blue to be negative. Please help me with this. I have tried flipud, but it changes the color pattern in the contour.
0 件のコメント
回答 (1 件)
Bjorn Gustavsson
2020 年 10 月 15 日
編集済み: Bjorn Gustavsson
2020 年 10 月 15 日
If you want exactly that colormap, but flip it you can do this:
cmp = colormap;
cmp = flipud(cmp);
colormap(cmp);
You should be able to re-set the colormap to jet in one call:
colormap(jet)
HTH
5 件のコメント
Bjorn Gustavsson
2022 年 4 月 28 日
Not that I disagree with your request for additional colormap-utilities, but "teribly cumbersome" might be a bit of an exageration for what can be done with something as simple as a one-liner:
colormap(flipud(colormap))
that is only 26 characters...
Adi Purwandana
2023 年 2 月 25 日
I tried some above codes... but I found working for me is:
colormap(flipud(jet))
参考
カテゴリ
Help Center および File Exchange で Red についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!