pymor.discretizers.builtin.gui.qt

Visualization of grid data using Qt.

This module provides a few methods and classes for visualizing data associated to grids. We use the Qt widget toolkit for the GUI.

Module Contents

Classes

PlotMainWindow

Base class for plot main windows.

Functions

background_visualization_method

_launch_qt_app

Wrapper to display plot in a separate process.

visualize_patch

Visualize scalar data associated to a two-dimensional Grid as a patch plot.

visualize_matplotlib_1d

Visualize scalar data associated to a one-dimensional Grid as a plot.

Attributes

_qt_app

_qt_windows

pymor.discretizers.builtin.gui.qt.background_visualization_method(method='ipython_if_possible')[source]
pymor.discretizers.builtin.gui.qt._launch_qt_app(main_window_factory, block)[source]

Wrapper to display plot in a separate process.

class pymor.discretizers.builtin.gui.qt.PlotMainWindow(U, plot, length=1, title=None)[source]

Bases: qtpy.QtWidgets.QWidget

Base class for plot main windows.

slider_changed(self, ind)[source]
speed_changed(self, val)[source]
update_solution(self)[source]
toggle_play(self, checked)[source]
rewind(self)[source]
to_end(self)[source]
step_forward(self)[source]
step_backward(self)[source]
closeEvent(self, event)[source]
pymor.discretizers.builtin.gui.qt._qt_app[source]
pymor.discretizers.builtin.gui.qt._qt_windows[source]
pymor.discretizers.builtin.gui.qt.visualize_patch(grid, U, bounding_box=([0, 0], [1, 1]), codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, backend='gl', block=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. 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.

backend

Plot backend to use (‘gl’ or ‘matplotlib’).

block

If True, block execution until the plot window is closed.

columns

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

pymor.discretizers.builtin.gui.qt.visualize_matplotlib_1d(grid, U, codim=1, title=None, legend=None, separate_plots=False, block=False)[source]

Visualize scalar data associated to a one-dimensional Grid as a plot.

The grid’s ReferenceElement must be the line. The data can either be attached to the subintervals 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 several plots are made into the same axes. The lengths of all arrays have to agree.

codim

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

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_plots

If True, use subplots to visualize multiple VectorArrays.

block

If True, block execution until the plot window is closed.