using colormap to assign one color for values => 0 and one for < 0

13 ビュー (過去 30 日間)
mashtine
mashtine 2014 年 11 月 14 日
回答済み: Kelly Kearney 2014 年 11 月 14 日
Hi,
I am having no luck using colormap or caxis to set the limits of the two colors on the colorbar. Is there a way (not using the colorbar editor) to easily set values < 0 to blue and values => 0 to red?

採用された回答

Kelly Kearney
Kelly Kearney 2014 年 11 月 14 日
colormap([0 0 1; 1 0 0]);
set(gca, 'clim', [-1 1]); % or any centered-on-0 limits

その他の回答 (0 件)

カテゴリ

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