why is it not possible to easily retrieve the auto-scaling factor used by quiver?

7 views (last 30 days)
By default quiver autoscales so that vectors "do not overlap". The algorithm used is presumably non-trivial, but the result is a real scalar (right?) that would be useful to some users. I am making movies of vector fields and each snapshot has a different scale -- somehow displaying this scale would be useful! Also, the modeled fields are derived from fitting data, and I would like to plot the data (also vector fields at a small number of sites) with vectors of a different color. The easiest (by far) way to do this is with two calls to quiver, one with the models grided locations and vectors, the other with the same for the data. But unless autoscale is turned off, the quiver plots will use different scale factors. I am turning off autoscale, and using known fixed scales. But then I have to make my own algorithm to define the scale. In some cases it woud be nice to use your more complex auto-scale algortihm for the first call, retrieve the scale factor, and use that with autoscale turned off for the second quiver call (even if I have to do the scaling myself). Is there a good reason why this can't be a property (that can t be set) so a user could retrieve it and use it for subsequent additions to the plot?

Answers (1)

Gojo
Gojo on 24 Jan 2024
Hi Gary,
I understand that you are trying to retrieve the scale factor used by “quiver” with “Autoscaling” option turned on and then use it for manually scaling subsequent quiver plot with the “Autoscaling” option disabled.
When creating a Quiver plot, there are two separate scaling operations that take place. Initially, the arrow lengths are adjusted to fit inside the plot area without overlapping. After that, scaling is carried out in accordance with the 'AutoScale' and 'AutoScaleFactor' attributes.
I hope this helps.
  1 Comment
Gary Egbert
Gary Egbert on 26 Jan 2024
yeah I know all of that, and figured out ways to get around the limitations of the existing matlab software. My questions was more directed to Mathworks --why the limitiation. Really more of a suggestion for futher improvements, for what it is worth.

Sign in to comment.

Categories

Find more on Vector Fields in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!