pymor.discretizers.builtin.gui.jupyter.kthreed

Classes

VectorArrayPlot

K3D plot of scalar data associated to a two-dimensional Grid.

Functions

visualize_k3d

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

class pymor.discretizers.builtin.gui.jupyter.kthreed.VectorArrayPlot(*args: t.Any, **kwargs: t.Any)[source]

Bases: Plot

K3D plot of scalar data associated to a two-dimensional Grid.

Used by visualize_k3d.

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=<matplotlib.colors.ListedColormap object>, background_color=16773836, 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.

Defaults

warp_by_scalar, scale_factor, background_color (see pymor.core.defaults)