Skip to content

Commit 96abe74

Browse files
authored
Merge pull request PyDMD#519 from karlic-luka/karlic-luka-patch_plot_summary_for_2d_modes
Fix plotter.plot_summary() method which doesn't plot modes correctly when given snapshots_shape for 2D snapshots
2 parents 47a860c + ebb668b commit 96abe74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pydmd/plotter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ def plot_summary(
899899
if len(snapshots_shape) == 2:
900900
if y is None:
901901
y = np.arange(snapshots_shape[1])
902-
ygrid, xgrid = np.meshgrid(y, x)
902+
xgrid, ygrid = np.meshgrid(x, y)
903903

904904
# PLOTS 4-6: Plot the DMD modes.
905905
for i, (ax, idx) in enumerate(zip(mode_axes, index_modes)):
@@ -913,7 +913,7 @@ def plot_summary(
913913
ax.plot(x, lead_modes[:, idx].real, c=mode_color)
914914
else:
915915
# Plot modes in 2-D.
916-
mode = lead_modes[:, idx].reshape(*snapshots_shape, order=order)
916+
mode = lead_modes[:, idx].reshape(xgrid.shape, order=order)
917917
vmax = np.abs(mode.real).max()
918918
im = ax.pcolormesh(
919919
xgrid,

0 commit comments

Comments
 (0)