How to colour contour temperature data over its lat and lon?
3 次查看(过去 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)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!