canvas
- m3sh.vis.canvas(*args, color=None, color2=None, camera=None, transparent=None, interactive=None, layer=None, shadows=None)[source]
Create or modify viewport.
Change properties of an existing viewport or create a new one inside the main render window. A viewport’s size and position is defined relative to the size of the render window in normalized coordinates.
The variable length argument list *args may hold 0 (to create new viewport), 1 (to make renderer current), 4 (to set viewport dimensions) or 5 values as documented below.
- Parameters:
renderer (vtkRenderer, optional) – Viewport identifier.
xmin (float, optional) – Smaller x-coordinate of the viewport.
xmax (float, optional) – Larger x-coordinate of the viewport.
ymin (float, optional) – Smaller y-coordinate of the viewport.
ymax (float, optional) – Larger y-coordinate of the viewport.
- Returns:
Active viewport. All subsequent plotting happen in this viewport.
- Return type:
vtkRenderer
Note
Passing a renderer as first positional argument makes it the current viewport. All
None
keyword arguments do not modify the corresponding property of the current viewport.- Keyword Arguments:
color (array_like, shape (3, ), optional) – Background color.
color2 (array_like, shape (3, ), optional) – Top background color.
camera (vtkRenderer or vtkCamera, optional) – Shared camera.
transparent (bool, optional) – Toggle transparent background.
interactive (bool, optional) – Toggle event notification.
layer (int, optional) – Layer index. Only for internal use.
shadows (bool, optional) – Render shadows, experimental.
Note
Setting interactive to
False
will prevent a viewport from receiving events. Note that widgets placed in such a non-interactive renderer still receive interaction events.Warning
Shadows are not computed correctly in non-square viewports! This is a known VTK bug.