pymor.discretizers.builtin.gui.jupyter.kthreed

Module Contents

class pymor.discretizers.builtin.gui.jupyter.kthreed.VectorArrayPlot(grid, U, codim, color_range, color_map, warp, bounding_box, show_mesh, *args, **kwargs)[source]

Bases: k3d.plot.Plot

Main K3D widget.

Attributes:
antialias: int:

Enable antialiasing in WebGL renderer, changes have no effect after displaying.

logarithmic_depth_buffer: bool.

Enables logarithmic_depth_buffer in WebGL renderer.

height: int:

Height of the Widget in pixels, changes have no effect after displaying.

background_color: int.

Packed RGB color of the plot background (0xff0000 is red, 0xff is blue), -1 is for transparent.

camera_auto_fit: bool.

Enable automatic camera setting after adding, removing or changing a plot object.

grid_auto_fit: bool.

Enable automatic adjustment of the plot grid to contained objects.

grid_color: int.

Packed RGB color of the plot grids (0xff0000 is red, 0xff is blue).

grid_visible: bool.

Enable or disable grid.

screenshot_scale: Float.

Multipiler to screenshot resolution.

voxel_paint_color: int.

The (initial) int value to be inserted when editing voxels.

label_color: int.

Packed RGB color of the labels (0xff0000 is red, 0xff is blue).

lighting: Float.

Lighting factor.

grid: array_like.

6-element tuple specifying the bounds of the plot grid (x0, y0, z0, x1, y1, z1).

camera: array_like.

9-element list or array specifying camera position.

camera_no_rotate: Bool.

Lock for camera rotation.

camera_no_zoom: Bool.

Lock for camera zoom.

camera_no_pan: Bool.

Lock for camera pan.

camera_rotate_speed: Float.

Speed of camera rotation.

camera_zoom_speed: Float.

Speed of camera zoom.

camera_pan_speed: Float.

Speed of camera pan.

camera_fov: Float.

Camera Field of View.

camera_damping_factor: Float.

Defines the intensity of damping. Default is 0 (disabled).

snapshot_type: string.

Can be ‘full’, ‘online’ or ‘inline’.

axes: list.

Axes labels for plot.

axes_helper: Float.

Axes helper size.

axes_helper_colors: List.

List of triple packed RGB color of the axes helper (0xff0000 is red, 0xff is blue).

time: list.

Time value (used in TimeSeries)

name: string.

Name of the plot. Used to filenames of snapshot/screenshot etc.

mode: str.

Mode of K3D viewer.

Legal values are:

view:

No interaction with objects,

add:

On voxels objects adding mode,

change:

On voxels objects edit mode,

callback:

Handling click_callback and hover_callback on some type of objects,

manipulate:

Enable object transform widget.

camera_mode: str.

Mode of camera movement.

Legal values are:

trackball:

orbit around point with dynamic up-vector of camera,

orbit:

orbit around point with fixed up-vector of camera,

fly:

orbit around point with dynamic up-vector of camera, mouse wheel also moves target point.

manipulate_mode: str.

Mode of manipulate widgets.

Legal values are:

translate:

Translation widget,

rotate:

Rotation widget,

scale:

Scaling widget.

auto_rendering: Bool.

State of auto rendering.

fps: Float.

Fps of animation.

minimum_fps: Float.

If negative then disabled. Set target FPS to adaptative resolution.

objects: list.

List of k3d.objects.Drawable currently included in the plot, not to be changed directly.

Methods

set

set(U, vmin, vmax, warp=None)[source]
pymor.discretizers.builtin.gui.jupyter.kthreed.visualize_k3d(grid, U, bounding_box=None, codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, columns=2, warp_by_scalar=True, scale_factor='auto', show_mesh=True, height=300, color_map=mpl.colormaps['viridis'], background_color=16777215, return_widget=True)[source]

Generate a k3d Plot for scalar data associated to a two-dimensional Grid.

The grid’s ReferenceElement must be the triangle or square. The data can either be attached to the faces or vertices of the grid.

Parameters

grid

The underlying Grid.

U

VectorArray of the data to visualize. If len(U) 1, the data is visualized as a time series of plots. Alternatively, a tuple of VectorArrays can be provided, in which case a subplot is created for each entry of the tuple. The lengths of all arrays have to agree.

bounding_box

A bounding box in which the grid is contained.

codim

The codimension of the entities the data in U is attached to (either 0 or 2).

title

Title of the plot.

legend

Description of the data that is plotted. Most useful if U is a tuple in which case legend has to be a tuple of strings of the same length.

separate_colorbars

If True, use separate colorbars for each subplot.

rescale_colorbars

If True, rescale colorbars to data in each frame.

columns

The number of columns in the visualizer GUI in case multiple plots are displayed at the same time.

warp_by_scalar

If True, visualize as a surface where the z-coordinate is determined by U.

scale_factor

If warp_by_scalar is enabled, the factor by which the values in U are scaled to obtain the z-coordinate. If set to 'auto', the scale factor is determined from the minimum/maximum values in U and the bounding_box.

show_mesh

If True and warp_by_scalar is enabled, additionally visualize the mesh in the (z=0)-plane.

height

Height of the subplots in pixels.

color_map

Matplotlib Colormap object or a K3D array((step, r, g, b)).

background_color

Background color of the plot.