How to display a color bar in Matlab as shown below
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello, experts.
I want to draw a color bar with discontinuous and regular intervals like the first picture above.
However, it would be best to draw a continuous color bar like the second picture. Is there a solution?
댓글 수: 0
답변 (3개)
Aquatris
2024년 8월 6일
You can call the colorbar function with the desired tick values
Z = peaks;
contourf(Z)
colorbar('ticks',[-6:0.5:8])
댓글 수: 0
Kunal Kandhari
2024년 8월 6일
you can use the 'colorbar' function. This allows you to represent both types of intervals effectively.
colorbar('ticks',[0.3:0.05:0.5])
read more about it here:
댓글 수: 0
Angelo Yeo
2024년 8월 6일
Small size of colormap leads to discrete-looking colorbar.
surf(peaks)
cmap = jet(10);
colormap(cmap)
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!