Skip to content

Instantly share code, notes, and snippets.

@WetHat
Last active October 16, 2024 07:33
Show Gist options
  • Save WetHat/1d6cd0f7309535311a539b42cccca89c to your computer and use it in GitHub Desktop.
Save WetHat/1d6cd0f7309535311a539b42cccca89c to your computer and use it in GitHub Desktop.
Matplotlib: 3D Arrows and 3D Annotations
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dennisfgardner
Copy link

Just what I needed. Thank you!!

@ksnxr
Copy link

ksnxr commented May 31, 2023

Thanks for the gist! Is there a license for it?

@luobroad
Copy link

luobroad commented Jul 7, 2023

One suggestion for this code is add return arrow to the end of def _arrow3D to read:

def _arrow3D(ax, x, y, z, dx, dy, dz, *args, **kwargs):
    '''Add an 3d arrow to an `Axes3D` instance.'''

    arrow = Arrow3D(x, y, z, dx, dy, dz, *args, **kwargs)
    ax.add_artist(arrow)
    return arrow

This will make other artist3d functions work, such as set_visible

@luobroad
Copy link

luobroad commented Jul 7, 2023

P.S. Would you like to PR to matplotlib? This would be helpful...

@anuarmenco
Copy link

tested on November 12, 2023 and works

@ShiboTan
Copy link

Thanks!

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