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

21 ビュー (過去 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.
P_L
P_L 2019 年 3 月 13 日
HI Jan,
problem solved. Thank you so much for trying to help.
I modified a function from
Many Thanks & all the best

サインインしてコメントする。

採用された回答

Jan
Jan 2019 年 3 月 12 日
Do you want to set the DataAspectRatio of the axes?

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeographic Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by