Skip to content

Commit

Permalink
🩹 Guard against crashes when SVD dimension are named differently
Browse files Browse the repository at this point in the history
e.g. when time and spectral are swapped around
  • Loading branch information
jsnel committed Aug 15, 2021
1 parent b6834e6 commit c118df7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyglotaran_extras/plotting/plot_svd.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def plot_lsv_residual(res, ax, indices=range(2), label="residual", linlog=False,
else:
rLSV = res.residual_left_singular_vectors
rLSV.isel(left_singular_value_index=indices[: len(rLSV.left_singular_value_index)]).plot.line(
x="time", ax=ax
x=rLSV.dims[0], ax=ax
)
ax.set_title("res. LSV")
if linlog:
Expand All @@ -58,7 +58,7 @@ def plot_rsv_residual(res, ax, indices=range(2)):
rRSV = res.residual_right_singular_vectors
rRSV.isel(
right_singular_value_index=indices[: len(rRSV.right_singular_value_index)]
).plot.line(x="spectral", ax=ax)
).plot.line(x=rRSV.dims[1], ax=ax)
ax.set_title("res. RSV")


Expand Down

0 comments on commit c118df7

Please sign in to comment.