How to make a color-map from lat long and data.

조회 수: 7 (최근 30일)
TAPAS
TAPAS 2020년 4월 25일
댓글: Ameer Hamza 2020년 4월 26일
I have an excel file which has 3 coloumns longitude,latitude and data.I want to make a colormap.How can I do that.I am attaching the data file and a picture which shows what I want to do.
  댓글 수: 1
Ameer Hamza
Ameer Hamza 2020년 4월 26일
Is the data in excel file only corresponds to colormap or the background image too?

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

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 26일
편집: Ameer Hamza 2020년 4월 26일
try this
data = readmatrix('data.xlsx');
lat = data(:,1);
lon = data(:,2);
val = data(:,3);
latV = linspace(min(lat), max(lat), 100);
lonV = linspace(min(lon), max(lon), 100);
[latG, lonG] = meshgrid(latV, lonV);
valG = griddata(lat, lon, val, latG, lonG);
contourf(latG, lonG, valG, 100, 'LineColor', 'none')
colormap(jet)
colorbar
  댓글 수: 4
Ameer Hamza
Ameer Hamza 2020년 4월 26일
You can try to plot it over the .grd file by using hold on.
Ameer Hamza
Ameer Hamza 2020년 4월 26일
You can use this package to read .grd file: https://www.mathworks.com/matlabcentral/fileexchange/25683-grdread2 and read the discussion here to see how to plot it: https://www.mathworks.com/matlabcentral/answers/446756-plot-grd-file.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by