How to colour contour temperature data over its lat and lon?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi hope all is well,
I have a set of field measurements of temperuature, and the lat lon and depth of where the observation was made. I am trying to plot these data onto a map with temperature in colour contour, at its lat lon it was taken.
My collection contains a mighty 45,000 ish rows thus elimated a few approaches such as mesh, my variables are : lat , lon , temp . I also used geoshow for background map, thus I believe would also be a limiting factor of code choices.
So far, I have tried to use the contour function but I kept getting an error of Z must be at least 2 by 2 , (however, my Z , temp is a single column array).
Please let me know how to plot my temp contours, thanks in advance
0 件のコメント
回答 (2 件)
KSSV
2019 年 2 月 4 日
Let lon,lat,Z be your data
M = 100 ; N = 100 ;
xi = linspace(min(lon),max(lon),M) ;
yi = linspace(min(lat),max(lat),N) ;
[Xi,Yi] = meshgrid(Xi,yi) ;
F = scatteredInterpolant(lon,lat,Z,'nearest','none') ;
Zi = F(Xi,Yi) ;
contourf(Xi,Yi,Zi)
3 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!