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!
2 个评论
回答(1 个)
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.Ticks = [-4:2:4];
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!