Change the aspect ratio of x,y to plot Longitude and Latitude correctly ( I have the conversion needed- need help implementing it)

조회 수: 32 (최근 30일)
Hi there,
I am wanting to change my x,y axis to reflect true longitude and latitude scales.
The conversion is: 1 degree of longitude (x-axis) is equal to 111cos(latitude). Latitude being the Y-axis. I need this in order to create a single scalebar rather than 2 seperate ones.
this is the code I have but I do not know how to implement it - any help would be much appreciated!
Many thanks!
load('x_data.mat')
load('y_data.mat')
load('z_data.mat')
h = pcolor(X,Y, Z);
shading interp
%% map personalising
xlabel('Longitude (deg, E)');
ylabel('Latitude (deg, N)')
axis equal
% set axis limits
xlim([30.3 30.45])
ylim([40.7 40.8])
hold on
  댓글 수: 8
Jan
Jan 2019년 3월 13일
@P_L: Please take into account, that I cannot read the code on your screen, if you do not post it here.
"Axesm - I can't get to project properly and display all the ticks- I have just been trying this just in 2D and world map doesn't dispaly anything evewn if I use pcolorm."
I cannot follow this description. Your code contains two calles of axesm, but they are commented - which one are you talkinh of.
"I will be using cellfun to plot data as well."
Why? Is this a part of the question?
"I initially tried plottinmg onto a map that I couldn't get to work for eveything"
Then please post the code and the error message, or a detailed description of the difference between your expectation and the results.
"Still not working" does not allow to give you any advice how to fix the code.

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

채택된 답변

Jan
Jan 2019년 3월 12일
Do you want to set the DataAspectRatio of the axes?

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by