How can I make my tick labels include 4 decimal places

조회 수: 29 (최근 30일)
Heidi Hirsh
Heidi Hirsh 2020년 11월 9일
댓글: Walter Roberson 2020년 11월 10일
I am trying to make a map over a very small area and three decimals is not enough to distinguish between longitude tick labels on my x axis. How can I tell it to include for decimals on that axis? It automatically includes 4 for my y axis.
figure
imagesc(AN(dlatlim,dlonlim))
set(gca,'Xtick',1:400:length(x_label2),'XTickLabel',x_label(1:400:length(x_label2)));
set(gca,'Ytick',1:400:length(y_label2),'YTickLabel',y_label(1:400:length(y_label2)));
set(gca,'fontsize',16)

답변 (1개)

Walter Roberson
Walter Roberson 2020년 11월 9일
ax = gca;
ax.XAxis.TickLabelFormat = '%.4g';
  댓글 수: 10
Heidi Hirsh
Heidi Hirsh 2020년 11월 10일
I think the x axis is also flipped. I'm so confused.
Walter Roberson
Walter Roberson 2020년 11월 10일
Are x_label or y_label sorted in descending order? If so then that imagesc call would flip the image.
But also some image related operations automatically set YDir property to 'reverse'

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

카테고리

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