customize jet color bar, white at zero

58 ビュー (過去 30 日間)
shinchan
shinchan 2012 年 6 月 29 日
回答済み: DGM 2023 年 1 月 15 日
I need to display my N by N matrix using imagesc(). Values in this matrix are from -1 to 1. I want to use jet color bar (blue to red) by inserting a white fade in the middle. I want to display it such that -1 to be dark blue, as value approaches 0, its color gradually fades to white, then complete white at 0, then as it moves away from 0, the white gradually goes to green then yellow then eventually red when value reaches 1. I can't figure out how to do it. I appreciate you guru's help.

回答 (2 件)

Adam Filion
Adam Filion 2012 年 6 月 29 日
The Examples section of the following doc page on the colormap editor contains the best easily available example I know of. You can follow the same steps to modify the jet colormap to your liking.

DGM
DGM 2023 年 1 月 15 日
This could be done with the colormapeditor(), but it's better to generate things programmatically. At least that way you can build it any length you want. This FEX submission does exactly what's described. It's jet(), but with white in the middle.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by