support vertical quiverkey#4516
support vertical quiverkey#4516ocehugo wants to merge 3 commits intomatplotlib:masterfrom ocehugo:master
Conversation
support a y aligned quiverkey. The label still need some work, since label=N | label=S still put the label over the arrow, but for label=W this works. Now it's possible to plot two quiverkeys that represents different motion scales (say in a x-z plane).
Add support to vertical align quiverkeys
lib/matplotlib/quiver.py
Outdated
There was a problem hiding this comment.
missing a np. for this array.
Sorry guys, i did this in a hurry and from memory of what i did in a local install without proper tools, so the code was not debugged.
|
needs a unit test. |
There was a problem hiding this comment.
This should be
rotation='vertical' if self._vswap else 'horizontal',|
Hello again, sorry to let this sit for a while, was forgotten in the middle of everything hehe (I read the notification some day and forgot to return). @tacaswell , just a quick check before working again, do u want to send all pop items that are inside that func into the arguments!? |
|
I do, but looking at this again, that is out of scope for this PR (I thought there was only one or two). Ignore that comment and leave the |
|
OK. So just change the rotation snippet or leave as is ? ( the dictionary with booleans was also used for consistency with the code). |
|
Still needs a test, and still need to utilize the ternery condition instead of the dictionary approach for vswap. |
add support to a vertical aligned (y wise) quiverkey.
The label for N and S are still over the arrow, but for label=W (my case) this snippet works.
Useful for a x-z plane quiver plot when the quiver arrows components have different units and user need to provide information about this in the plot. The currently default behaviour is to only plot a horizontal (x) quiverkey, while the vertical is assumed to be the same.
This also support the user to select if he wants to make a key that is horizontal or vertical aligned. Say that the flow is along y and the quiverkey is horizontal, the reader always need to rotate in his mind the vector to have a grasp about the magnitude.