Display colorbar label horizontally and specify its position

60 次查看(过去 30 天)
In this example
figure;
[x, y, z] = sphere;
surf(x, y, z);
c = colorbar;
c.Label.String = 'Z';
I would like the colorbar label to be displayed vertically and in the top right corner off the colorbar. How can I do it?

采纳的回答

KL
KL 2017-10-24
编辑:KL 2017-10-24
EDITED
pos = get(c,'Position');
c.Label.Position = [pos(1)/2 pos(2)+1]; % to change its position
c.Label.Rotation = 0; % to rotate the text

更多回答(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