Modifying colourmap to suit needs

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!

Antworten (1)

Steven Lord
Steven Lord am 14 Apr. 2020

0 Stimmen

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')

Produkte

Version

R2014a

Tags

Gefragt:

am 14 Apr. 2020

Beantwortet:

am 14 Apr. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by