Visualization¤
plot_2dvec(ax, vec)
¤
Plot a 2D vector field.
Cleanups up the axes and returns the quiver object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ax |
Axes
|
Axes to plot on. |
required |
vec |
ndarray
|
[2, ...] 2D Vector field to plot. |
required |
Returns:
Type | Description |
---|---|
Quiver
|
Quiver object. |
Source code in pdearena/visualization.py
plot_scalar(ax, scalar)
¤
Plot a scalar field.
Cleanups up the axes and returns the image object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ax |
Axes
|
Axes to plot on. |
required |
scalar |
ndarray
|
2D Scalar field to plot. |
required |
Returns:
Type | Description |
---|---|
AxesImage
|
Image object. |
Source code in pdearena/visualization.py
plot_scalar_sequence_comparison(init_field, ground_truth, prediction, fontsize=37, text_loc=(-10, 64))
¤
Plot a scalar field sequence comparison.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
init_field |
ndarray
|
Initial scalar field. We only plot the last time step of the initial field. |
required |
ground_truth |
ndarray
|
Ground truth scalar field. |
required |
prediction |
ndarray
|
Predicted scalar field. |
required |
fontsize |
int
|
Fontsize for the text annotations. Defaults to 37. |
37
|
text_loc |
tuple
|
Location of the text annotations. Defaults to (-10, 64). |
(-10, 64)
|
Returns:
Type | Description |
---|---|
Figure
|
Figure object. |