Replication of a colorbar in MatLab
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello everyone
I am trying to impement this colorbar:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1563824/image.png)
My attempt has been the following:
colorA=[192 148 92]./255;
colorB=[1 1 1];
colorC=[82 107 120]./255;
cmap3=vertcat(interp1([0 1],[colorA;colorB],linspace(0,1,numcolors/2),'linear'),interp1([0 1],[colorB;colorC],linspace(0,1,numcolors/2+1),'linear'));
cmap3(numcolors/2+1,:)=[];
cmap3=flip(cmap3,1);
clear colorA colorB color C numcolors
which I have done trying to pick the extremal colors at each side of the aforementioned colorbar. However, I obtain something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1563829/image.png)
without that nice blue color evolution on the right side of it. Any suggestions on how to get closer to the reference image?
댓글 수: 0
채택된 답변
DGM
2023년 12월 8일
I just reconstructed it from the image. See the attached file.
Z = peaks(100);
imagesc(Z)
colorbar
colormap(orangeaqua(256))
댓글 수: 0
추가 답변 (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!