The “contour” function is expected to map according to the x and y coordinates. From the images, it seems that –90 in the contour in Figure 3 is mapped to 90W on the base map in Figure 2. Since the contour is based on Xi, Yi inputs, is this the mapping that you are looking for?
Misaligned contour and base map
1 次查看(过去 30 天)
显示 更早的评论
Hi People,
I am tying to contour a variable over a base map in the polar region. Although they look fine seperately, they seemed to be misaligned when put together like the image here (if you open the image in another tap, you shall see all of it)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202911/image.png)
My code is like such:
xi = linspace(min(lon_6c),max(lon_6c), 1000) ;
yi = linspace(min(lat_6c),max(lat_6c), 1000) ;
[Xi,Yi] = meshgrid(xi,yi) ;
F = scatteredInterpolant(lon_6c,lat_6c,temp_6c,'natural') ;
Zi = F (Xi,Yi) ;
figure
hold on
m_coast('patch',[1 .6 .5]);
m_grid('box','fancy','tickdir','in');
contour(Xi,Yi,Zi)
Please help :3
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!