https://github.com/dashidhy/mplot3d_dragger
Allow dragging in 3d plots
https://github.com/dashidhy/mplot3d_dragger
3d-plot 3d-vision 3d-visualization matplotlib
Last synced: about 1 month ago
JSON representation
Allow dragging in 3d plots
- Host: GitHub
- URL: https://github.com/dashidhy/mplot3d_dragger
- Owner: dashidhy
- License: mit
- Created: 2019-07-17T03:01:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-17T04:45:51.000Z (over 6 years ago)
- Last Synced: 2025-11-27T18:45:49.472Z (3 months ago)
- Topics: 3d-plot, 3d-vision, 3d-visualization, matplotlib
- Language: Python
- Size: 2.93 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mplot3d_dragger
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.
## Install
```bash
pip install mplot3d-dragger
```
## Usage
```Python
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()
plt.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