Jet Colormap with black and white at the ends

조회 수: 62(최근 30일)
AAS 2020년 9월 14일
편집: Adam Danz 2020년 9월 14일
Is there a way to get the jet colormap to have black at its lowest end and white at its highest end instead of blue and red respectively. Just to be clear, I still want the jet colors in the middle of this band.
Thank you!!


Adam Danz
Adam Danz 2020년 9월 14일
편집: Adam Danz 2020년 9월 14일
cm = [0 0 0; jet(20); 1 1 1];

Ruger28 2020년 9월 14일
You could just create a colormap, and then add a single row for black and a row for white at the beginning and the end respectively. Is that you you are looking for?
JetMap = colormap(jet);
JetMap = [[0 0 0];JetMap;[1 1 1]];
xvals = [1:66];
yvals = [1:66];

Star Strider
Star Strider 2020년 9월 14일
Try this:
grid on
colormap([0 0 0;jet(14);1 1 1]) % Append ‘White’ & ‘Black’ To The Ends Of The ‘jet’ Colormap


Community Treasure Hunt

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

Start Hunting!

Translated by