anyplotlib.Plot3D#
- class anyplotlib.Plot3D(geom_type, x, y, z, *, colormap='viridis', color='#4fc3f7', point_size=4.0, linewidth=1.5, x_label='x', y_label='y', z_label='z', azimuth=-60.0, elevation=30.0, zoom=1.0)[source]#
Bases:
object3-D plot panel.
Supports three geometry types matching matplotlib’s 3-D Axes API:
'surface'– triangulated surface, Z-coloured via colormap.'scatter'– point cloud, single colour.'line'– connected line through 3-D points.
Created by
Axes.plot_surface(),Axes.scatter3d(), andAxes.plot3d().Not an anywidget. Holds state in
_statedict; every mutation calls_push()which writes to the parent Figure’s panel trait.- Parameters:
- on_key(key_or_fn=None)[source]#
Register a key-press handler for this panel.
Two call forms are supported:
@plot.on_key('q') # fires only when 'q' is pressed def handler(event): ... @plot.on_key # fires for every registered key def handler(event): ...
The event carries:
key,mouse_x,mouse_y, andlast_widget_id.Note
Registered keys take priority over the built-in r (reset view) shortcut.
- Return type:
- disconnect(cid)[source]#
Remove the callback registered under integer cid.
- Parameters:
cid (int)
- Return type:
None
- set_colormap(name)[source]#
Set the surface colormap (ignored for scatter/line).
- Parameters:
name (str)
- Return type:
None