Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👌 Improve SVD plotting #64

Merged
merged 4 commits into from
Mar 10, 2022
Merged

Conversation

s-weigand
Copy link
Member

@s-weigand s-weigand commented Mar 10, 2022

This PR fixes #50 and also adds arguments to specify the number of residual vectors to plot.

As an additional bonus plot_lsv_data and plot_rsv_data are now agnostic towards the x dimensions name, since the x dimension selection works by using not sv_index_dim.

Before:

grafik
grafik

After:

Change number of SVD vectors

grafik
grafik

Deactivate legend:

grafik
grafik

Change summary

Checklist

  • ✔️ Passing the tests (mandatory for all PR's)
  • 👌 Closes issue (mandatory for ✨ feature and 🩹 bug fix PR's)

Closes issues

closes #50

Since singular vectors with a lower index correspond to a bigger singular value their contribution is more important and thus they should be plotted on top of singular vectors with a higher index.
@s-weigand s-weigand requested a review from a team as a code owner March 10, 2022 12:28
@github-actions
Copy link
Contributor

Binder 👈 Launch a binder notebook on branch s-weigand/pyglotaran-extras/improve-SVD-plotting

@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

Merging #64 (d4fc16e) into main (432b32f) will decrease coverage by 0.56%.
The diff coverage is 4.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
- Coverage   41.42%   40.85%   -0.57%     
==========================================
  Files          22       22              
  Lines         618      629      +11     
  Branches       87       90       +3     
==========================================
+ Hits          256      257       +1     
- Misses        362      372      +10     
Impacted Files Coverage Δ
pyglotaran_extras/plotting/plot_data.py 40.00% <0.00%> (ø)
pyglotaran_extras/plotting/plot_overview.py 28.57% <0.00%> (ø)
pyglotaran_extras/plotting/plot_svd.py 19.40% <5.26%> (-2.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 432b32f...d4fc16e. Read the comment docs.

@s-weigand s-weigand changed the title Improve svd plotting 👌 Improve SVD plotting Mar 10, 2022
@s-weigand
Copy link
Member Author

@jsnel Thanks for spotting that I messed up the default number of data SVD vectors in plot_overview (fixed in d4fc16e)

@s-weigand
Copy link
Member Author

As a reference about matplotlib zorder in case we need it again ^^

Copy link
Member

@jsnel jsnel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now 😊

pyglotaran_extras/plotting/plot_overview.py Outdated Show resolved Hide resolved
@jsnel jsnel merged commit abd21ed into glotaran:main Mar 10, 2022
@s-weigand s-weigand deleted the improve-SVD-plotting branch March 10, 2022 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Invert plot order for SVD vector plots
2 participants