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
pythreejslibrary. 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 (
tuple[int,int] |None, default:None) – The width and height of the renderer in pixels.title (
str|None, default:None) – The title to be placed above the figure. It is possible to use HTML formatting to customize the title appearance.camera (
Camera|None, 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.
has_user_xlabel()Return
Trueif the user has set an x-axis label.has_user_ylabel()Return
Trueif the user has set a y-axis label.has_user_zlabel()Return
Trueif the user has set a z-axis label.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
emptyCheck if the canvas is empty.
titleGet or set the title of the plot.
xmaxGet or set the maximum x-axis value.
xminGet or set the minimum x-axis value.
xrangeGet or set the range/limits of the x-axis.
ymaxGet or set the maximum y-axis value.
yminGet or set the minimum y-axis value.
yrangeGet or set the range/limits of the y-axis.
zmaxGet or set the maximum z-axis value.
zminGet or set the minimum z-axis value.
zrangeGet or set the range/limits of the z-axis.