Display Scale on Quiver Plot

45 ビュー (過去 30 日間)
Jack B
Jack B 2015 年 2 月 15 日
コメント済み: kalani Lakshani 2021 年 3 月 4 日
Hello,
I'm looking to display the scale of my arrows on a quiver plot I've produced in relation to the plot itself. So the reader can look at my arrows and understand how they're size relate to the axis of the plot. I hope I'm being clear. Let me know if I'm not.
I basically don't know how to do this. Can anyone offer some suggestions or tips to make this happen.
Jack.

回答 (2 件)

Felipe Breton
Felipe Breton 2018 年 12 月 20 日
I had the same need, so what I did was to add one extra point in my map with a reference velocity. Then I added some text close to this "reference arrow" to explain it. Of course, some empty space on the map is needed. Basically, it would be as follows:
Taking the example shown in quiver.m 's reference page:
[x,y] = meshgrid(0:0.2:2,0:0.2:2);
u = cos(x).*y;
v = sin(x).*y;
figure
But then:
%An additional row of points is added at y=2.2:
[X,Y]=meshgrid([0:0.2:2],2.2);
%Then a reference arrow velocity is defined at x=0.2 and y=2.2, while rest of points are left as zero:
u_rf=zeros(1,11);
v_rf=zeros(1,11);
u_rf(1,2)=1;
%Thus, quiver plot is applied including the new row:
quiver([X;x],[Y;y],[u_rf;u],[v_rf;v]); %is done like this to be sure we got the same arrow AutoScale
%Finally some text is included:
text(0.05,2.3,'Arrow scale: 1m/s')
Resulting in the following plot:
example ref arrow.bmp
I hope it may help someone, as this post it quite old.
Felipe.

Star Strider
Star Strider 2015 年 2 月 15 日
I never thought about doing that with quiver. I’m not certain that what you want to do is possible, but experiment with Quiver Series Properties, specifically those listed under ‘Arrow’.
  3 件のコメント
Star Strider
Star Strider 2015 年 2 月 15 日
My pleasure!
The arrow lengths scale themselves, so I’m not certain exactly how you would display the scale on a legend or some such. I’ve never see this addressed anywhere, and I've never done it myself. I occasionally turned the 'AutoScale','off' to show the arrows for short segments (where the arrows might not otherwise be visible), but otherwise I just let them alone.
kalani Lakshani
kalani Lakshani 2021 年 3 月 4 日
Hello @Jack B
Can I know whether you found the answer for your question?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by