How can I change only one color in my colormap?
조회 수: 3 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
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
2015년 6월 11일
Yes.
yourColorMap = jet(256);
yourColorMap(1, :) = [1,1,1];
colormap(yourColorMap);
colorbar;
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!