|
Hi,
I have the same problem. I'm plotting six wind velocity fields that need to be correctly scaled to each other. I don't know how to prevent quiver from autoscaling, but I found a workaround that allows two graphs in the same figure to scale `correctly':
stretch = mean(mean(magnitude) )*arrowScale;
h = quiver(xcoord, ycoord, uvel, vvel, stretch);
arrowScale is the same for all plots. You can set it to whatever value makes the plots visible (1000, 0.001, etc).
It's quick and dirty, but it produces a figure that makes visual sense. If you have a graph and then the same graph with all the magnitudes doubled, then the arrows will come out the right length.
To apply the same idea to your situation, if the second resolution is twice the first (for example), the autoscaling will make arrows half as long, so you'll need to stretch them back by a factor of two. Something like this might work:
stretch = (1/gridScale)*arrowScale;
Hope that helps,
David
"Merce Casas Prat" <merce.casas@upc.edu> wrote in message <hc6s2o$jvl$1@fred.mathworks.com>...
> Hi,
>
> I have a question about quiver function in Matlab. If you plot a vector field (e.g wind) with a certain resolution and then you plot in the same figure a second wind field with a higher resolution, these two fields are plotted in a different scale (in order not to overlap, etc.). The (my) problem is: the function quiver autoscales the vectors and then (optionally) applies a scale factor (defined by the user). If you deactivate the autoscaling (setting scale=0) then you cannot choose any scale. Do you know how to control exactly the scale of the vector without any previous autoscaling (so I will be able to have a plot with 2 wind fields in the same scale)? And do you know any simple way to insert a legend in a quiver plot (i.e. a legend with, for example, an unitary horizontal vector)
>
> Thanks
>
> Merc
|