MATLAB Answers

How to get the the arrow length as legend in quiver function ?????

82 ビュー (過去 30 日間)
shanas pr
shanas pr 2016 年 2 月 9 日
Answered: elias GR 2018 年 2 月 13 日
I am plotting vectors using quiver function.quiver(x,y,u,v)
suppose u and v are wind components arrow should show something similar to this (----> 3 m/s). length of the arrow should show as legend.
how can I do this with the help of quiver function.
Thanks in advance

  0 件のコメント

サインイン to comment.

採用された回答

elias GR
elias GR 2018 年 2 月 13 日
I had the same problem. I finally used the following workaround: 'hold on' the figure and use the 'quiver' command again in order to display just one vertical vector of a given length. Then write its length using e.g. text command. Mind the 'AutoScale' option, you better disable it in all 'quiver' commands in order to be sure about the vector length.
This solution requires that you have some empty space in your plot in order to display this extra vector and its length. Moreover, it does not display the reference vector in the legend but I think that this is ok.

  0 件のコメント

サインイン to comment.

More Answers (0)

サインイン してこの質問に回答します。


Translated by