How to align colorbar YTickLabel as middle/left/right?

4 次查看(过去 30 天)
imshow('rice.png')
h = colorbar;
h.YTickLabel = cellstr([char(num2str([1,5000000,1000,5000,10000,15000]')),repmat(' (USD)',6,1)]);
The T tick lable is centralized, which is very ugly. I there a way to make it aligned left or right?
  3 个评论
raym
raym 2017-10-27
There is no option to align, and the only way to tweak is to adjust the input o f the TickLabel.
raym
raym 2017-10-27
To align left:
imshow('rice.png')
h = colorbar;
YTickLabels = strtrim(cellstr([char(num2str([1,5000000,1000,5000,10000,15000]')),repmat(' (USD)',6,1)]));
h.YTickLabel = YTickLabels;

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by