Shapefile not overlapping perfectly over pcolor plot
Ältere Kommentare anzeigen
I am trying to plot a pcolor plot for Sea surface temperature data set and to represent the coastaline in the plot i have downloadwed global coastline shapefile and when i am using geoshow to read and overlay on the pcolor plot it is not matching perfectly 

6 Kommentare
Umar
am 24 Jul. 2024
Hi Muskula,
Since you have not shared data and code, the only conclusion I can draw is alignment issues which can occur due to differences in coordinate systems or projections. Ensure that both the coastline shapefile and the pcolor plot are using the same coordinate system. You may need to reproject one of the datasets to match the other.
Muskula
am 25 Jul. 2024
Umar
am 25 Jul. 2024
Bearbeitet: Walter Roberson
am 25 Jul. 2024
Hi Muskula,
Here is an updated version of the code snippet provided by you with some modifications for better alignment:
[Y, X] = meshgrid(linspace(-179.750, 179.750, 720), linspace(89.750, -89.750, 360));
h1 = pcolor(Y, X, Data);
hold on
coastline = shaperead("ne_50m_coastline.shp");
geoshow(coastline, 'DisplayType', 'line', 'EdgeColor', [0 0 0]);
In this updated code snippet, you can read the coastline shapefile using shaperead to obtain the coastline data, use geoshow with 'DisplayType', 'line' to overlay the coastline as a line on the pcolor plot, Adjusting the properties of the coastline display as needed for better alignment. By following these steps and ensuring proper coordinate system alignment and scaling, you should be able to overlay the coastline accurately on the pcolor plot. Please let me know if this helps resolve your issue.
Muskula
am 27 Jul. 2024
Umar
am 27 Jul. 2024
Hi Muskula,
Like I said in my earlier comments, “ Since you have not shared data and code, the only conclusion I can draw is alignment issues which can occur due to differences in coordinate systems or projections”. Glad to know your problem is resolved. So, this answers your question.
Antworten (0)
Kategorien
Mehr zu Mapping Toolbox finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!