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

1 次查看(过去 30 天)
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.

采纳的回答

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.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by