フィルターのクリア

Display colorbar label horizontally and specify its position

73 ビュー (過去 30 日間)
Viesturs Veckalns
Viesturs Veckalns 2017 年 10 月 24 日
編集済み: KL 2017 年 10 月 24 日
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
  2 件のコメント
Viesturs Veckalns
Viesturs Veckalns 2017 年 10 月 24 日
I don't want to change the location of the colorbar but the location of the colorbar label.
KL
KL 2017 年 10 月 24 日
Ah ok, I completely missed it. Check my edited answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by