필터 지우기
필터 지우기

how to change my lat and lon value to more precise notation ?

조회 수: 1 (최근 30일)
Akim Mahmud
Akim Mahmud 2018년 1월 29일
댓글: Walter Roberson 2018년 2월 7일
Hi,
I have these two images ( please see the attached). the first image is taken from a paper and I made the second image. i want to make my 2nd image lat and lon notation look exactly the same as my first image. like 70 degree W inastead of just 70. Is there any way to change the format ? Thanks and i would accept any answers.
-Akim

채택된 답변

Walter Roberson
Walter Roberson 2018년 1월 29일
Since R2015a or so:
ax = gca;
ax.XRuler.TickLabelFormat = '%g \\circ W';
This will not use the true degree symbol: for that instead use
ax = gca;
ax.XRuler.TickLabelFormat = sprintf('%%g%s W', char(176));
  댓글 수: 2
Akim Mahmud
Akim Mahmud 2018년 1월 29일
thanks very much. looks like it worked but it added negative signs in front the numbers. How do i get rid of the negative signs ( please see the attached ) ? Thanks again
Walter Roberson
Walter Roberson 2018년 2월 7일
Unfortunately you cannot control the negative sign by using the TickLabelFormat and will instead need to set the XTickLabel property to contain a cell array of the exact strings you want to use.
If you expect the user to zoom or pan then you will need to add support for a resize callback to change the XTickLabel property to suit the new axes limits.
If you expect the user to be able to use the data cursor then you will need to use datacursormode() and an UpdateFcn to construct the appropriate strings instead of the decimal degrees.

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

추가 답변 (0개)

카테고리

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