plopp.backends.pythreejs.canvas.Canvas#
- class plopp.backends.pythreejs.canvas.Canvas(figsize=None, title=None, camera=None, **ignored)[source]#
WebGL canvas used to render 3D graphics. It is based on the
pythreejs
library. It provides a scene, camera, controls, as well as functions for controlling the camera. In addition, it draws a RGB axes helper for the XYZ dimensions, and can draw an outline box, given a spatial range in the three directions.- Parameters:
figsize (
Optional
[tuple
[int
,int
]], default:None
) – The width and height of the renderer in pixels.title (
Optional
[str
], default:None
) – The title to be placed above the figure. It is possible to use HTML formatting to customize the title appearance.camera (
Optional
[Camera
], default:None
) – Initial camera configuration (position, target).
Methods
__init__
([figsize, title, camera])add
(obj)Add an object to the
scene
.bigger
()camera_x_normal
()View scene along the X normal.
camera_y_normal
()View scene along the Y normal.
camera_z_normal
()View scene along the Z normal.
draw
()Create an outline box with ticklabels, given a range in the XYZ directions.
home
()Reset the camera position.
move_camera
(position[, look_at])Move the camera to the supplied position.
remove
(obj)Remove an object from the
scene
.set_axes
(dims, units, dtypes)Set the axes dimensions and units.
smaller
()to_widget
()toggle_axes3d
()Toggle the visibility of the RGB helper axes.
toggle_outline
()Toggle the visibility of the outline box.
update_legend
()Attributes
empty
Check if the canvas is empty.
title
Get or set the title of the plot.
xmax
Get or set the maximum x-axis value.
xmin
Get or set the minimum x-axis value.
xrange
Get or set the range/limits of the x-axis.
ymax
Get or set the maximum y-axis value.
ymin
Get or set the minimum y-axis value.
yrange
Get or set the range/limits of the y-axis.
zmax
Get or set the maximum z-axis value.
zmin
Get or set the minimum z-axis value.
zrange
Get or set the range/limits of the z-axis.