Is it possible to eliminate a color range from certain colormap?
조회 수: 9 (최근 30일)
이전 댓글 표시
I am using colormap hsv in my plots, but I do not want the upper red color in the colorbar because it can be confusing with the lower red. Can I manually edit this color range?
Thanks
![Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/212084/Untitled.png)
댓글 수: 0
답변 (2개)
KSSV
2019년 4월 5일
Z = peaks(100) ;
figure(1)
pcolor(Z)
cmap = hsv ;
colormap(cmap)
% Remove red
idx = cmap(:,1)==1 ;
cmap(idx,:) = [] ;
figure
pcolor(Z)
colormap(cmap)
댓글 수: 0
DGM
2022년 1월 28일
Old, I know ...
If you want to break the circularity of hsv(), you can do so by doing the interpolation yourself:
z = peaks(100);
ncolors = 64;
cm = hsv(6); % the minimal set of primaries and secondaries
cm = interp1(1:6,cm,linspace(1,6,ncolors));
imagesc(z);
colormap(cm)
colorbar
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!