Add geographic data to pcolor plot

조회 수: 9 (최근 30일)
Louise Wilson
Louise Wilson 2022년 3월 31일
편집: Louise Wilson 2022년 3월 31일
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일
hold on
load coast.mat
plot(long,lat,'k')
  댓글 수: 3
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개)

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by