Modifying colourmap to suit needs

4 ビュー (過去 30 日間)
Caillin O'Rourke
Caillin O'Rourke 2020 年 4 月 14 日
回答済み: Steven Lord 2020 年 4 月 14 日
Hello all,
Just wondering if its possible to modify the colourmap, to have it using the gray scale, but have the range of colours between 0 and 1, i.e. 0 being white and 1 being black, or vice versa.
if so, how?
Thanks!

回答 (1 件)

Steven Lord
Steven Lord 2020 年 4 月 14 日
Just flip the colormap.
figure
peaks
colorbar
colormap gray % effectively equivalent, due to how colormap works, to colormap(gray)
title('Normal')
figure
peaks
colorbar
colormap(flip(gray))
title('Flipped')

カテゴリ

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

タグ

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by