plopp.backends.pythreejs.canvas.Canvas#

class plopp.backends.pythreejs.canvas.Canvas(figsize=(600, 400), title=None, camera=None)[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 (Tuple[int, int], default: (600, 400)) – 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).

__init__(figsize=(600, 400), title=None, camera=None)[source]#

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.

home()

Reset the camera position.

make_outline(limits)

Create an outline box with ticklabels, given a range in the XYZ directions.

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.

Attributes

empty

Check if the canvas is empty.

title

Get or set the title of the plot.