필터 지우기
필터 지우기

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 CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by