Create a specular colormap

조회 수: 4 (최근 30일)
Maria445
Maria445 2019년 3월 15일
편집: Adam 2019년 3월 15일
I'm using the patch function with a "hot" colormap.
However, I'd like the colormap to be specular; namely I'd like it to be centered on zero and have the same color for positive and negative values with the same absolute value.
Is it possible to do it?

채택된 답변

Adam
Adam 2019년 3월 15일
편집: Adam 2019년 3월 15일
figure; imagesc( rand(100) - 0.5 ); % Random data centred on 0
baseCmap = hot( 256 );
cmap = [ flip( baseCmap(2:end,:) ); baseCmap ];
colormap( cmap )
caxis( [-0.5 0.5] )
  댓글 수: 1
Maria445
Maria445 2019년 3월 15일
Thank you a lot!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Color and Styling에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by