How do you remove tick marks (not labels) from a colorbar?
38 次查看(过去 30 天)
显示 更早的评论
I have a figure plotted with imagesc and the associated colorbar. How do I remove the tick marks from the colorbar?
0 个评论
采纳的回答
Star Strider
2022-9-15
Try this —
cm = [1 0 0; 1 1 1; 0 0 1]; % Basic Colormap
cmi = interp1([-2; 0; 5], cm, (-2:5)) % interpolated Colormap
M = randi([-2 5],9) % Matrix
figure
imagesc(M)
colormap(cmi)
hcb = colorbar;
figure
imagesc(M)
colormap(cmi)
hcb = colorbar;
hcb.TickLength = 0; % Set TickLength' To 0
.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Orange 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!