![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/177650/image.jpeg)
How can I show in a map a certain value in given its latitude and longitude?
3 次查看(过去 30 天)
显示 更早的评论
Hello, I have a 3D(Lat,Long,Value) array as:
-3.69834356435644 40.3692049504951 55.2800325952722
-5.75910000000000 41.6759400000000 278.508909991090
1.05841800000000 41.6189370000000 21.5032056211029
-0.436050000000000 39.3093500000000 17.2475501005075
-0.292116000000000 38.5694000000000 91.8952819098190
-4.19764000000000 37.2504133333333 126.180495487668
1.27530961538462 41.2542115384615 237.219637267762
-3.64700000000000 40.4734000000000 6.22601788331549e-13
-3.70983333333333 40.4095000000000 1.36949196158669
-3.77925000000000 40.4540750000000 4.40546655566579
-8.50187222222223 37.3327888888889 964.334069593729
-6.87703666666667 37.0378233333333 397.966638769665
-3.70237777777778 40.3868611111111 3.62935043132483
-3.84033469387755 39.0579571428572 62.1590511465560
2.40896363636364 41.5235454545455 21.7058628942069
How can I generate a spatial heatmap given this structure? Thanks in advance.
0 个评论
回答(1 个)
bio lim
2015-7-9
编辑:bio lim
2015-7-9
I think the following is what you are asking for.
A = [-3.69834356435644 40.3692049504951 55.2800325952722;
-5.75910000000000 41.6759400000000 278.508909991090;
1.05841800000000 41.6189370000000 21.5032056211029;
-0.436050000000000 39.3093500000000 17.2475501005075;
-0.292116000000000 38.5694000000000 91.8952819098190;
-4.19764000000000 37.2504133333333 126.180495487668;
1.27530961538462 41.2542115384615 237.219637267762;
-3.64700000000000 40.4734000000000 6.22601788331549e-13;
-3.70983333333333 40.4095000000000 1.36949196158669;
-3.77925000000000 40.4540750000000 4.40546655566579;
-8.50187222222223 37.3327888888889 964.334069593729;
-6.87703666666667 37.0378233333333 397.966638769665;
-3.70237777777778 40.3868611111111 3.62935043132483;
-3.84033469387755 39.0579571428572 62.1590511465560;
2.40896363636364 41.5235454545455 21.7058628942069];
colormap('hot')
imagesc(A(:,2), A(:,1), A(:,3))
xlabel('Longitude');
ylabel('Latitude');
colorbar
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/177650/image.jpeg)
2 个评论
bio lim
2015-7-10
N = 1000;
[Xi, Yi] = meshgrid(linspace(37,42,N),linspace(-6.9,2.5,N));
Ci = griddata(A(:,2), A(:,1), A(:,3), Xi, Yi);
colormap ('hot')
imagesc(linspace(37,42,N),linspace(-6.9,2.5,N),Ci);
xlabel('Longitude');
ylabel('Latitude');
colorbar
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/183455/image.jpeg)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!