Size of color bar including labels in Matlab R2014b [duplicate]

爷,独闯天下 提交于 2019-12-05 13:45:41

Try:

original = get(c, 'Position')
set(c, 'Position', [original(1) original(2)*0.5, original(3), original(4)*0.5])

The handle c contains a 'Position' property, same as many graphics handles. Look up the documentation to understand it more fully. To verify that this translates the position of colorbar title and labels too, execute the following:

set(get(c, 'YLabel'), 'String', {'a', 'b', 'c'})     % Arbitrary Labels
set(get(c, 'Title'), 'String', {'Colorbar Title'});  % Arbitrary Title
set(c, 'Position', [original])                       % Resize back to original and observe!
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!