Skip to content

Commit 199b707

Browse files
committed
Fix mode titles
1 parent 84787c4 commit 199b707

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pydmd/bopdmd.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ def plot_mode_uq(
14041404
figsize=None,
14051405
dpi=None,
14061406
plot_modes=None,
1407-
plot_complex_pairs=True,
1407+
plot_conjugate_pairs=True,
14081408
):
14091409
"""
14101410
Plot BOP-DMD modes alongside their standard deviations.
@@ -1439,9 +1439,9 @@ def plot_mode_uq(
14391439
Note that if this parameter is given as a list of indices, it will
14401440
override the `plot_complex_pair` parameter.
14411441
:type plot_modes: int or iterable
1442-
:param plot_complex_pairs: Whether or not to omit one of the modes that
1442+
:param plot_conjugate_pairs: Whether or not to omit one of the modes that
14431443
correspond with a complex conjugate pair of eigenvalues.
1444-
:type plot_complex_pairs: bool
1444+
:type plot_conjugate_pairs: bool
14451445
"""
14461446
if self.modes_std is None:
14471447
raise ValueError("No UQ metrics to plot.")
@@ -1450,7 +1450,7 @@ def plot_mode_uq(
14501450
nd, r = self.modes.shape
14511451
if plot_modes is None or isinstance(plot_modes, int):
14521452
mode_indices = np.arange(r)
1453-
if not plot_complex_pairs:
1453+
if not plot_conjugate_pairs:
14541454
if r % 2 == 0:
14551455
mode_indices = mode_indices[::2]
14561456
else:
@@ -1459,7 +1459,7 @@ def plot_mode_uq(
14591459
mode_indices = mode_indices[:plot_modes]
14601460
else:
14611461
mode_indices = plot_modes
1462-
plot_complex_pairs = True
1462+
plot_conjugate_pairs = True
14631463

14641464
# By default, modes_shape is the flattened space dimension.
14651465
if modes_shape is None:
@@ -1506,10 +1506,10 @@ def plot_mode_uq(
15061506

15071507
# Plot the average mode.
15081508
plt.subplot(rows, cols, avg_inds[i] + 1)
1509-
if plot_complex_pairs:
1509+
if plot_conjugate_pairs or (r % 2 == 1 and i == 0):
15101510
plt.title(f"Mode {idx + 1}")
1511-
if not plot_complex_pairs:
1512-
plt.title(f"Mode {idx + 1}, {idx + 2}")
1511+
else:
1512+
plt.title(f"Modes {idx + 1},{idx + 2}")
15131513
if len(modes_shape) == 1:
15141514
# Plot modes in 1-D.
15151515
plt.plot(x, mode.real, c="tab:blue")

0 commit comments

Comments
 (0)