Modifying colourmap to suit needs

4 vues (au cours des 30 derniers jours)
Caillin O'Rourke
Caillin O'Rourke le 14 Avr 2020
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!

Réponses (1)

Steven Lord
Steven Lord le 14 Avr 2020
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')

Catégories

En savoir plus sur White dans Help Center et File Exchange

Tags

Produits


Version

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by