I have a matrices of values which I want to use to create a pcolor plot.
My data is constrained by water depths where I have set all depth >100m to NaN and all values of 0 to NaN.
This has created a confusing plot where I'm unable to show coastal outlines properly.
How would I change this plot so that I retain my '0 depth' or land values but create a black outline that will clearly show the outline of the coasts.
Thanks.

 채택된 답변

KSSV
KSSV 2022년 9월 4일

1 개 추천

You can use contour.
Let X, Y, H be your data of (x,y) coordinates and H be your depth.
figure
hold on
pcolor(X,Y,H)
shading interp
contour(X,Y,H,[0 0],'k')

댓글 수: 1

Charlie Milford
Charlie Milford 2022년 9월 4일
Thank you for your answer it works perfectly and will use in future. I ended up using the m_map addon and imported a coastal data zip file in the end.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Coastal Engineering에 대해 자세히 알아보기

태그

질문:

2022년 9월 4일

댓글:

2022년 9월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by