How can I change only one color in my colormap?

조회 수: 3 (최근 30일)
Julia Mödl
Julia Mödl 2015년 6월 11일
댓글: Julia Mödl 2015년 6월 12일
I plot a 3dimensional temperature distribution via interpn in the whole space. so the data that are not defined by my input data appear as zero. to put them as NaN does not work for the programm to run. So i want to change the color for c=0 to white so it doesnt disturb the view. how can I do that?

채택된 답변

Image Analyst
Image Analyst 2015년 6월 11일
Assuming the 0 value is the first row of your color map:
yourColorMap(1, :) = [1,1,1];
  댓글 수: 3
Image Analyst
Image Analyst 2015년 6월 11일
Yes.
yourColorMap = jet(256);
yourColorMap(1, :) = [1,1,1];
colormap(yourColorMap);
colorbar;
Julia Mödl
Julia Mödl 2015년 6월 12일
Thanks so much, works perfect! :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by