Alignment problems with vector data using mapping toolbox

1 view (last 30 days)
Hi, I have the following code to display vector data on a map in MATLAB. *****************************************************************************
figure [LONG, LAT]=meshgrid(linspace(min(long),max(long)),linspace(min(lat),max(lat)));
F = TriScatteredInterp(long,lat,elevation);
qz = F(LONG,LAT);
axesm('MapProjection','eqaconic', 'MapParallels',[],... 'MapLatLimit',[47 61], 'MapLonLimit',[-125 -85])
axis off; framem; gridm; mlabel; plabel
geoshow('PrairiesBoundaries.shp', 'DisplayType','polygon','FaceColor','white', 'EdgeColor','none')
[cs,h]=contour(LONG,LAT,qz,'.k','LineWidth',1.3);
clabel(cs,h,'fontsize',12);
hcb = colorbar('horiz'); set(get(hcb,'Xlabel'),'String','elevation')_____
**************************************************************************
I can correctly read the 'PrairiesBoundaries.shp' shapefile from ESRI, display the rivers, lakes and land areas correctly. However, when I interpolate elevation as in the code and use 'contour', I face problems here. The contours fail to align within the bounding box. Instead, contours are displayed somewhere else. I do not know how to get around with geographic coordinates in this case. It is easy in arcgis to define geographic coordinate of each layer to be same as that of data frame.
Please help, if possible with an example. Asong.

Answers (0)

Categories

Find more on Geographic Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!