How can plot boundary to quiver figure

Hi to all
I have this code, which plots the current, how can I plan the boundary in this figure and add the color blue inside and brown outside the perimeter as ( sea and land ).
((Thank you in advance))
clear; close all; clc
il=60;jl=30;ii=12;jj=2;
load tab;
lon=A(:,1);
lat=A(:,2);
depPr=A(:,3);
z=A(:,4);
u=A(:,5);
v=A(:,6);
is=((il*jl)*3)+1;
ie=(is+(il*jl))-1;
zz=z(is:ie);
for i=1:7:24
figure
quiver(lon(is:ie),lat(is:ie),u(is:ie),v(is:ie))
is=ie+1;
ie=is+(il*jl)-1;
end

Answers (1)

You can use boundary to obtain a bounding outline. You might want to play with the alpha coefficient.
Once you have a boundary you can use fill(). The inside is the easy part. To fill the outside, you could consider setting the axes background color instead of filling... that would probably be notably easier than constructing "outside minus inside" for fill purposes.

Categories

Asked:

on 17 Jun 2023

Answered:

on 17 Jun 2023

Community Treasure Hunt

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

Start Hunting!