How can plot boundary to quiver figure
Afficher commentaires plus anciens
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

Réponses (1)
Walter Roberson
le 17 Juin 2023
0 votes
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.
Catégories
En savoir plus sur Vector Fields dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!