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.
- antialias[source]¶
int
: Enable antialiasing in WebGL renderer, changes have no effect after displaying.
- background_color[source]¶
int
. Packed RGB color of the plot background (0xff0000 is red, 0xff is blue), -1 is for transparent.
- camera_auto_fit[source]¶
bool
. Enable automatic camera setting after adding, removing or changing a plot object.
- grid[source]¶
array_like
. 6-element tuple specifying the bounds of the plot grid (x0, y0, z0, x1, y1, z1).
- camera_up_axis[source]¶
str
. Fixed up axis for camera.Legal values are:
- X:
x axis,
- Y:
y axis,
- Z:
z axis,
- None:
Handling click_callback and hover_callback on some type of objects.
- axes_helper_colors[source]¶
List
. List of triple packed RGB color of the axes helper (0xff0000 is red, 0xff is blue).
- mode[source]¶
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[source]¶
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[source]¶
str
. Mode of manipulate widgets.Legal values are:
- Translate:
Translation widget,
- Rotate:
Rotation widget,
- Scale:
Scaling widget.
- objects[source]¶
list
. List ofk3d.objects.Drawable
currently included in the plot, not to be changed directly.
Methods
- 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. Iflen(U) 1
, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrays
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 caselegend
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 byU
.scale_factor – If
warp_by_scalar
is enabled, the factor by which the values inU
are scaled to obtain the z-coordinate. If set to'auto'
, the scale factor is determined from the minimum/maximum values inU
and thebounding_box
.show_mesh – If
True
andwarp_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.