I'm using the patch function with a "hot" colormap.
However, I'd like the colormap to be specular; namely I'd like it to be centered on zero and have the same color for positive and negative values with the same absolute value.
Is it possible to do it?

 採用された回答

Adam
Adam 2019 年 3 月 15 日
編集済み: Adam 2019 年 3 月 15 日

1 投票

figure; imagesc( rand(100) - 0.5 ); % Random data centred on 0
baseCmap = hot( 256 );
cmap = [ flip( baseCmap(2:end,:) ); baseCmap ];
colormap( cmap )
caxis( [-0.5 0.5] )

1 件のコメント

Maria445
Maria445 2019 年 3 月 15 日
Thank you a lot!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeColor and Styling についてさらに検索

製品

リリース

R2018b

質問済み:

2019 年 3 月 15 日

編集済み:

2019 年 3 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by