How can I draw points with 3 column data

조회 수: 1 (최근 30일)
Dung Nguyen
Dung Nguyen 2023년 3월 22일
댓글: Cameron 2023년 3월 23일
Dear friend
I have a data file with 3 columns as 1 column is longitude, 2 column is latitude and column 3 is values. I want to draw a figure which I attached. I tried with 'scatter' and 'pcolor' but I didn't succeed. I attached a figure as a example and a data file. I hope someone can help me.

답변 (1개)

Cameron
Cameron 2023년 3월 22일
You can adjust your plot as needed.
data = webread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1332705/tec.txt');
numericdata = str2num(data);
longitude = numericdata(:,1);
latitude = numericdata(:,2);
color = numericdata(:,3);
geoscatter(latitude,longitude,color,color,'filled')
colormap('turbo')
colorbar
  댓글 수: 2
Dung Nguyen
Dung Nguyen 2023년 3월 23일
Dear Cameron
Thanks for your replying. I run your code but it inform a error (I sent a figure in the attachements). I use matlab 2016a, It does not have 'geoscatter'. I coppy 'geoscatter' in another verision of matlab. Can you check to help me?
Cameron
Cameron 2023년 3월 23일
All of the geoaxes plots I'm aware of are only available in R2017b and later releases. If possible, I would try to update to a more recent version as there have been 14 major releases since R2016a.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by