필터 지우기
필터 지우기

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

조회 수: 47 (최근 30일)
shanas pr
shanas pr 2016년 2월 9일
편집: Himanshu 2024년 7월 3일 8:12
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

채택된 답변

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.
  댓글 수: 1
Himanshu
Himanshu 2024년 7월 3일 8:11
편집: Himanshu 2024년 7월 3일 8:12
Can you please share the code and show how to generate just one vertical vector as legend.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by