Modifying colourmap to suit needs

조회 수: 1 (최근 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 CenterFile Exchange에서 White에 대해 자세히 알아보기

태그

제품


릴리스

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by