Skip to content
Get started

eqiora.matplotlib

← Python API index

Plot Eqiora results with Matplotlib.

View source

Run uv add "eqiora[matplotlib]" in the project environment described in Get started. Continue with a scalar spatial result and its Model field field from modeling:

python
from eqiora.matplotlib import plot_scalar_field
figure = plot_scalar_field(result, field=field)
figure.savefig("field.png", dpi=150)

The color scale shows the field’s values on its mesh. For a displacement field, use plot_deformed_field(result, field=field, scale=10.0); scale magnifies the display without changing the computed displacement.

Plot the reference geometry and the geometry deformed by a scaled displacement.

python
@overload
def plot_deformed_field(trajectory: Trajectory, /, *, step: int, field: FieldRef, scale: float=1.0) -> Figure: ...
@overload
def plot_deformed_field(result: Result, /, *, field: FieldRef, scale: float=1.0) -> Figure: ...

Plot a vertex field or a derived per-cell scalar from a Result.

python
@overload
def plot_scalar_field(trajectory: Trajectory, /, *, step: int, field: FieldRef | DerivedFieldSnapshot) -> Figure: ...
@overload
def plot_scalar_field(result: Result, /, *, field: FieldRef) -> Figure: ...