Can anyone advise me as to how I can add geographic information to a pcolor plot?
Each of the variables I have is a 12500x800 matrix (these variables are too large to attach here).
I have plotted using the following code:
h=pcolor(new_lon,new_lat,new_maxdata);
set(h,'EdgeColor','none');
colorbar
caxis([0 100])
hold on;
xlabel('Longitude')
ylabel('Latitude')
set(gca,'tickdir','out','layer','top','fontname',...
'arial','fontsize',12);
I'd like to add land for the region, just to at least show where the land begins, not necessarily super detailed. I considered geoscatter() but it doesn't work with matrices. Are there any other options? Maybe I have to add a separate plot on top with land data?

 採用された回答

KSSV
KSSV 2022 年 3 月 31 日

0 投票

hold on
load coast.mat
plot(long,lat,'k')

3 件のコメント

Louise Wilson
Louise Wilson 2022 年 3 月 31 日
編集済み: Louise Wilson 2022 年 3 月 31 日
Thanks for your answer! This code works but plots a diagonal line in the top right of the plot which doesn't actually correspond to the land in the region. When I zoom out, I can see that this is just because the land outline is not detailed enough to represent the actual coastline in the region which is a ~ 5km ^2 area.
KSSV
KSSV 2022 年 3 月 31 日
From the below link, try downloading your required domain shape file and plot the data.
Louise Wilson
Louise Wilson 2022 年 3 月 31 日
Thanks. I actually have a shapefile I could use already! Got it working now :-)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

リリース

R2020b

質問済み:

2022 年 3 月 31 日

編集済み:

2022 年 3 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by