Fix quiver key plot when angles='xy' and/or scale_units='xy' #27044
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR summary
Closes #26316 #26748 #27008
Fix incorrect behavior for quiver key. When
angles='xy'
and/orscale_units='xy'
, incorrect results will be produced for polar and aitoff.Problem:
This happens because
ax.quiverkey()
reusesquiver._make_verts()
to produce the arrow. During the call,quiver._angles_lengths()
will be called whenangles='xy'
and/orscale_units='xy'
. This methods will calculate the results using[X, Y]
input fromquiver()
anyway, therefore, causing the resultquiverkey()
be broadcasted to wrong demension (instead of 1). This also applies to Cartesian - even if the result looks correct, multiple arrows were plotted at the same place.Fix:
ax.quiverkey()
will callquiver._make_verts(..., angles)
only withangles='uv'
. This is because we are usingdegrees
to describe the angle for quiver key, not two points.quiver._angles_lengths()
now explicitly requires inputing[X, Y]
, rather than using those fromax.quiver()
call.test_quiver.test_quiver_key_xy
- the old one looks different than how it is specified in the doc [Bug]: quiverkey behavior with quiver(scale_units="xy") #27008PR checklist