Shapefile not overlapping perfectly over pcolor plot
이전 댓글 표시
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
Umar
2024년 7월 24일
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
2024년 7월 25일
Umar
2024년 7월 25일
편집: Walter Roberson
2024년 7월 25일
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
2024년 7월 27일
Umar
2024년 7월 27일
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.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Mapping Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!