How do I scale separate quiver subplots to be the same scale in relation to each other?

38 次查看(过去 30 天)
Hello,
My code runs a for loop to obtain several subplots to put onto one figure. However, when using the AutoScale property of the quiver function, it appears that the arrows scale down to fit onto the plot. This is inconvenient as I would like all the arrows to be the same scale in relation to each other across all plots. Is this a possibility? Essentially, I would like to not use the AutoScale property (so that they are all the same scale) but to still be able to scale the arrows down so they all fit inside their respective plots (not individually).
If this is not possible, is there a way to provide a legend of the size of arrow in relation to magnitude of velocity?
Many thanks, Adam

回答(1 个)

Jyotish Robin
Jyotish Robin 2017-3-27
编辑:Jyotish Robin 2017-3-27
Hi Adam!
From the query, I understand that you would like to have the arrows in the quiver plots to be of the same scale across all plots.
Turning off the 'AutoScale' property of "quiver" prevents "quiver" from rescaling vectors according to the data. By manually scaling the data, the same scale can be kept between two quiver plots.
You can find more info about the same in the following link:
If you are interested in knowing how "quiver" scale the vector it plots, see the following link: https://www.mathworks.com/matlabcentral/answers/94454-how-does-quiver-scale-the-vectors-it-plots
To know how to adjust the arrowhead proportions when the x-data and y-data ranges differ substantially, see the following link:
Hope you find the above suggestions helpful ! :)
  1 个评论
Adam Curran
Adam Curran 2017-3-27
Hi Jyotish Robin,
Thanks very much! The first two links have provided great help. Practically kicking myself now, as it seems so obvious haha
Since I posted this, I have been finding putting up values on the graph to display what magnitudes the velocities my vector plots have a bit messy. As suggested above, I thought a legend with an arrow displaying what 0.1m/s looked like would be useful. Any good way to do this without having to plot the arrow some place in the figure myself?
Or any suggestions to display the values would be gratefully received!
Many thanks again, Adam

请先登录,再进行评论。

类别

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