How to set minorticks in colorbar?

조회 수: 17 (최근 30일)
Felix
Felix 2022년 1월 6일
댓글: Simon Chan 2022년 1월 7일
Hello,I am trying to set XMinorTicks on Colorbar, by doing:cb= colorbar('southoutside', 'Ticks',[0:0.25:0.75]); cb.XMinorTick = 'on';
I tried set(cb, 'XMinorTick', 'on') as well, but it does not work out. I tried to find out if this property is still available for colorbar but I did not find a answer.
Can anybody help me how to set minorticks for colorbar?
Thanks in advanceFelix

답변 (1개)

Simon Chan
Simon Chan 2022년 1월 7일
Try the following:
ax = axes('position',cb.Position);
set(ax,'XMinorTick','on');
  댓글 수: 2
Felix
Felix 2022년 1월 7일
Hello, thank your for your answer. Just have a look to the following Code:
colormap( jet (15));
c= colorbar;
c.Location = 'southoutside';
c.Ticks= 0:0.625:1.25;
%c.XAxis.MinorTick = 'on' does not work;
caxis ([0 1.25]); %Bereich der legende
c.LineWidth = 0.75;
c.FontSize= 8; %Schriftgröße
c.FontWeight= 'normal';
ax = axes('position',c.Position);
set(ax,'XMinorTick','on');
Now it creates a second bar. How can I match the Minorticks with the first bar?
Thank you for your help and time. Felix
Simon Chan
Simon Chan 2022년 1월 7일
Sorry I don't have my laptop on hand and hence just answer via my phone. You may try the following.
Note that it is not yet tested.
ax.XMinorTickValues = 0:0.625:1.25

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

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by