Skip to main content

Allow dragging in matplotlib 3d plots.

Project description


Allow dragging in matplotlib 3d plots.

Why this

It seems that dragging is not support by matplotlib when drawing and visualizing 3D plots interactively, though rotating and zooming are supported. This can be very inconvenient when you want to visualize and observe a small part of a 3D plot with large range, e.g., a large point cloud scene. Thus, if you also meet this problem like I do, have a try of this one.


pip install mplot3d-dragger


import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

# import Dragger3D
from mplot3d_dragger import Dragger3D

fig = plt.figure()
ax = Axes3D(fig)

# ... (your plotting) ...

# wrap your axes with Dragger3D
dr = Dragger3D(ax) 
# or for real-time dragging
# dr = Dragger3D(ax, real_time=True)
# but this can be stuttering 
# when you have a lot of objects in one figure

# show()

Press SPACE, drag 3D objects by moving your cursor on figure (do not press mouse key), and release SPACE.

To do list

  • Drag alone z axis

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mplot3d-dragger, version 0.0.0
Filename, size File type Python version Upload date Hashes
Filename, size mplot3d_dragger-0.0.0-py3-none-any.whl (3.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size mplot3d_dragger-0.0.0.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page