필터 지우기
필터 지우기

How to modify the distance between the numbers and the bar and increase tick width in a matlab colorbar?

조회 수: 1 (최근 30일)
Dear Matlab experts,
I need a nice colorbar with numbers.
But the bar generated was too close to the tick labels (See the following picture). And the line width of ticks were too small.
Therefore, do you know how to set the distance between the number and the colorbar and increase the line width of ticks?
Or do you have available codes for a nicer colorbar?
Thank you!

답변 (1개)

Chunru
Chunru 2022년 7월 20일
x = randi([-4 4], [8 7]);
subplot(121);
imagesc(x);
colormap(jet)
h1 = colorbar;
subplot(122);
imagesc(x);
colormap(jet)
h2 = colorbar
h2 =
ColorBar with properties: Location: 'eastoutside' Limits: [-4 4] FontSize: 7.6500 Position: [0.8232 0.1109 0.0239 0.8152] Units: 'normalized' Show all properties
h2.Ticks = [-4:2:4];

카테고리

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