Skip to content

Commit 46edba5

Browse files
committed
typo
1 parent b0df1d4 commit 46edba5

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/irrevolutions/utils/viz.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
from dolfinx.plot import vtk_mesh as compute_topology
33
import matplotlib.tri as tri
44
import matplotlib.pyplot as plt
5-
from pyvista.plotting.utilities import xvfbimport pyvista
5+
from pyvista.plotting.utilities import xvfb
6+
import pyvista
67
from mpi4py import MPI
78
import logging
89
import sys
@@ -24,6 +25,7 @@
2425
# Start Xvfb for PyVista (for offscreen rendering)
2526
# xvfb.start_xvfb(wait=0.05)
2627

28+
2729
def plot_vector(u, plotter, subplot=None, scale=1.0):
2830
"""
2931
Plots a vector field using PyVista with glyph representation.
@@ -64,6 +66,7 @@ def plot_vector(u, plotter, subplot=None, scale=1.0):
6466
plotter.set_background("white")
6567
return plotter
6668

69+
6770
def plot_scalar(u, plotter, subplot=None, lineproperties={}):
6871
"""
6972
Plots a scalar field using PyVista.
@@ -98,7 +101,17 @@ def plot_scalar(u, plotter, subplot=None, lineproperties={}):
98101
plotter.set_background("white")
99102
return plotter
100103

101-
def plot_profile(u, points, plotter, subplot=None, lineproperties={}, fig=None, ax=None, subplotnumber=1):
104+
105+
def plot_profile(
106+
u,
107+
points,
108+
plotter,
109+
subplot=None,
110+
lineproperties={},
111+
fig=None,
112+
ax=None,
113+
subplotnumber=1,
114+
):
102115
"""
103116
Plots a profile of the solution at given points.
104117
@@ -131,6 +144,7 @@ def plot_profile(u, points, plotter, subplot=None, lineproperties={}, fig=None,
131144
plt.legend()
132145
return plt, (points_on_proc[:, 0], u_values)
133146

147+
134148
def plot_mesh(mesh, ax=None):
135149
"""
136150
Plots the mesh using Matplotlib.
@@ -151,6 +165,7 @@ def plot_mesh(mesh, ax=None):
151165
ax.triplot(tria, color="k")
152166
return ax
153167

168+
154169
def get_datapoints(u, points):
155170
"""
156171
Retrieves data points for a given solution field evaluated at specific points.
@@ -182,6 +197,7 @@ def get_datapoints(u, points):
182197

183198
return points_on_proc, u_values
184199

200+
185201
def plot_perturbations(comm, Lx, prefix, β, v, bifurcation, stability, i_t):
186202
"""
187203
Plots the perturbations using PyVista.
@@ -249,6 +265,7 @@ def plot_perturbations(comm, Lx, prefix, β, v, bifurcation, stability, i_t):
249265

250266
return plotter
251267

268+
252269
def plot_matrix(M):
253270
"""
254271
Plots the matrix as a heatmap using Matplotlib.
@@ -269,4 +286,4 @@ def plot_matrix(M):
269286
c = _M[j, i]
270287
ax.text(i, j, f"{c:.3f}", va="center", ha="center")
271288

272-
return fig
289+
return fig

0 commit comments

Comments
 (0)