How to modify the distance between the numbers and the bar and increase tick width in a matlab colorbar?
3 ビュー (過去 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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154645/image.png)
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!