how to get a plot quiver with velocity magnitude
6 ビュー (過去 30 日間)
古いコメントを表示
How to get a quiver plot with change in color basing on velocity vector magnitude
0 件のコメント
回答 (1 件)
Priyanshu Mishra
2019 年 11 月 27 日
Hi Bharathi,
You can use 'color' linespec to change the color of your velocity vectors. For your reference I have written a code. You may take help of it.
[x,y] = meshgrid(0:0.2:2,0:0.2:2);
u = cos(x).*y;
v = sin(x).*y;
figure
quiver(x,y,u,v,'color',[1 0 0])
The above code will give you red color velocity vectors. By changing the linespec for eg. [1 1 0], it will give you yellow color.
1 件のコメント
Daniele Morandi
2022 年 11 月 25 日
Hi Priyanshu,
I guess that Bharathi meant that color could change depending on velocity magnitude, similarly to what happen in contour plot.
Colorbar should help reading magnitude related to color, if this is possible
参考
カテゴリ
Help Center および File Exchange で Vector Fields についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!