Change colorbar title position latex

조회 수: 22 (최근 30일)
Turbulence Analysis
Turbulence Analysis 2020년 10월 19일
댓글: Turbulence Analysis 2020년 10월 20일
Hi,
In the attached figure, I would like to reposition the colorbar axis title to be along with colorbar. May I know how to change the psotion.
set(c,'String',['$','\omega','(1/s)','$'],'Interpreter','latex','fontsize',18);

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 19일
Try something like this
c = colorbar;
c.Title.String = '$\omega(1/s)$';
c.Title.Interpreter = 'latex';
c.Title.FontSize = 16;
c.Title.Units = 'data';
c.Title.Position(1:2) = [3.5 mean(c.Limits)]; % adjust value of 3.5 until you get correct horizontal position
  댓글 수: 10
Turbulence Analysis
Turbulence Analysis 2020년 10월 20일
Sorry,, Here is the attachment..
Turbulence Analysis
Turbulence Analysis 2020년 10월 20일
I sorted the issue. The caxis ([-0.02 0.02]); which is defined just after the c.Title.Rotation = 90; causes the problem, I have moved this to the top just after the imagesc(x,y,(New3));.
Hence, now the position of colorbar title is remains unaltered across all the images in for loop.
Thanks....

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colorbar에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by