pymor.discretizers.builtin.gui.jupyter
¶
This module provides plotting support inside the Jupyter notebook.
To use these routines you first have to execute
%matplotlib notebook
inside the given notebook.
Submodules¶
Package Contents¶
Functions¶
Function decorator for marking function arguments as user-configurable defaults. |
|
Visualize scalar data associated to a two-dimensional |
|
Attributes¶
- pymor.discretizers.builtin.gui.jupyter.defaults(*args)[source]¶
Function decorator for marking function arguments as user-configurable defaults.
If a function decorated with
defaults
is called, the values of the marked default parameters are set to the values defined viaload_defaults_from_file
orset_defaults
in case no value has been provided by the caller of the function. Moreover, ifNone
is passed as a value for a default argument, the argument is set to its default value, as well. If no value has been specified usingset_defaults
orload_defaults_from_file
, the default value provided in the function signature is used.If the argument
arg
of functionf
in sub-modulem
of packagep
is marked as a default value, its value will be changeable by the aforementioned methods under the pathp.m.f.arg
.Note that the
defaults
decorator can also be used in user code.Parameters
- args
List of strings containing the names of the arguments of the decorated function to mark as pyMOR defaults. Each of these arguments has to be a keyword argument (with a default value).
- pymor.discretizers.builtin.gui.jupyter.visualize_patch(grid, U, bounding_box=None, codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, columns=2)[source]¶
Visualize scalar data associated to a two-dimensional
Grid
as a patch plot.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 (defaults to grid.bounding_box()).
- 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.