Quiver. Make wind scale of 1m/s inside plot
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Luis Jesús Olvera Lazcano
am 21 Sep. 2023
Kommentiert: Luis Jesús Olvera Lazcano
am 23 Sep. 2023
I have had a really tough time thinking of a way to show a scale of the wind vectors that Im plotting.
Im using quiversc(lon,lat,u,v) but I dont know how to put a magnitude of reference (1 m/s for example) , as in the plot below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1488892/image.png)
Thanks!
0 Kommentare
Akzeptierte Antwort
Chunru
am 21 Sep. 2023
Bearbeitet: Chunru
am 21 Sep. 2023
[x, y] = meshgrid(-2:.2:2);
z = x.*exp(-x.^2-y.^2);
[dx, dy] = gradient(z, 0.2);
sc = 'off'; % scale
quiver(x,y,dx,dy, sc);
axis tight;
hold on
a = axis;
% posision of the ref arrow
xr = a(1)+0.1*(a(2)-a(1));
yr = a(4)-0.1*(a(4)-a(3));
quiver(xr, yr, 1, 0, sc) % unit lenght
6 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Vector Fields finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!