Skip to content

'pivot' property not recognised in quiver #3907

Closed

Description

@szymk

When I try to set the 'pivot' kw argument to any value, the result is:

Traceback (most recent call last):
  File "plotInpTrajOut_LocBag.py", line 265, in <module>
    ax.quiver(x,y,z,u,v,w,length=0.2,color=colors[guid_nb],pivot='tail')
  File "/usr/lib/python2.7/dist-packages/mpl_toolkits/mplot3d/axes3d.py", line 2614, in quiver
    linec = art3d.Line3DCollection(lines, *args[argi:], **kwargs)
  File "/usr/lib/python2.7/dist-packages/mpl_toolkits/mplot3d/art3d.py", line 171, in __init__
    LineCollection.__init__(self, segments, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/collections.py", line 1060, in __init__
    **kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/collections.py", line 132, in __init__
    self.update(kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/artist.py", line 757, in update
    raise AttributeError('Unknown property %s' % k)
AttributeError: Unknown property pivot

I'm using matplotlib 1.4.2-3 under debian
BTW, it seems to me that the documentation on possible 'pivot' values is not consistent.

Hope it helps!

Activity

  1. tacaswell commented on Dec 11, 2014

    @tacaswell
    Member

    It looks like you are using the 3D version of quiver which I think only just got support for the pivot kwarg #3735. That code is on master, but won't be back-ported to the 1.4.x branch.

  2. added this to the milestone on Dec 11, 2014
  3. szymk commented on Dec 23, 2014

    @szymk
    Author

    Yes, you're right, I was using quiver in 3D. I'll follow the development
    and switch to the new code when available. Thanks for your answer!

    Best regards,

    Szymon

    On 11 December 2014 at 18:53, Thomas A Caswell [email protected]
    wrote:

    It looks like you are using the 3D version of quiver which I think only
    just got support for the pivot kwarg #3735
    #3735. That code is on
    master, but won't be back-ported to the 1.4.x branch.

    —
    Reply to this email directly or view it on GitHub
    #3907 (comment)
    .

    Szymon Krupinski
    [email protected]

  4. efiring commented on Dec 24, 2014

    @efiring
    Member

    The documentation inconsistency you note is that "mid" is an alternative to "middle".

  5. modified the milestones: v1.4.3, on Dec 24, 2014
  6. tacaswell commented on Dec 28, 2014

    @tacaswell
    Member

    Not sure what we want to do about this, from looking at the code tip.* -> 'tip', 'mid.*' -> 'middle' and anything else results in tail.

    ex

    X, Y = np.meshgrid(np.linspace(-np.pi, np.pi, 16), np.linspace(-np.pi, np.pi, 16))
    v = np.sin(X)
    u = np.cos(Y)
    plt.quiver(X, Y, u, v)
    plt.quiver(X, Y, u, v, color='b', pivot='ardvaark', alpha=.5)

    Results in no error and blue arrows overlaid on the black:

    so

    @efiring I am going to close this issue and make a new one for improving the validation on quiver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions