Error in the simultaneous use of contourf and geolimits
2 次查看(过去 30 天)
显示 更早的评论
I have a problem with my code. I am trying to combine two kinds of maps. the first one is the contour map, and the ather one is the geomap with the geolimit command.
My code is above:
figure(5)
S=shaperead('C:\Users\hp\Desktop\MY_MAP.shp');
lat_grid2=ltln(:,1);
lon_grid2=ltln(:, 2);
Z=ltln(:, 3);
[lon_si, lat_si] = meshgrid(...
linspace(min(lon_grid2),max(lon_grid2)),...
linspace(min(lat_grid2),max(lat_grid2)));
m_alli = griddata(lon_grid2,lat_grid2,Z, lon_rmsi,lat_rmsi,'natural');
contourf(lon_si,lat_si,m_alli,15,'ShowText','on');
mapshow(S,'Color', 'black','LineWidth',2)
set(gca,'ColorScale','log');
colormap(flipud(jet(5)));
colorbar
geolimits([min(lon_grid2) max(lon_grid2)], [min(lat_grid2) max(lat_grid2)])
but command window shows me the error:
Error using geolimits (line 66)
Unable to use geolimits. Current axes or chart is not geographic.
Could you please help me?
0 个评论
采纳的回答
Walter Roberson
2022-8-1
use contourm() with 'Fill' option perhaps
contourf() is just contour() with fill, not a different computation
12 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!