Feat: API for plotting multiple 2D slices from the same dataset at different distances - #109
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #109 +/- ##
==========================================
- Coverage 69.63% 62.60% -7.04%
==========================================
Files 5 5
Lines 326 369 +43
==========================================
+ Hits 227 231 +4
- Misses 99 138 +39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
IgorTatarnikov
left a comment
There was a problem hiding this comment.
Hi @nikas-belogolov, this is a great start. Could you remove the commented out code please?
I think the position argument is being overloaded with too many functions with this addition.
Perhaps, we add a new format. Currently, we support either "2D", or "3D". I propose we add a new "2D_multi" (name to be iterated on) that signals the internal machinery to work with multiple slicers instead of just one. This would allow self.slicer to always be the first position, and self.slicers to be a new optional list that's only filled/used when users request this new "2D_multi" mode.
We should also expose the nrows/ncols of the subplots to the user along with passing **kwargs to the underlying plt.subplot function. This is to avoid hard coding a specific size, or aspect ratio.
|
@IgorTatarnikov Thank you for the review, I will implement your suggestions by the end of the week for a final review and a merge |
|
@IgorTatarnikov I've added a new format 2D_multi for multiple slicers, and exposed nrows, ncols & figsize to the user |
Description
What is this PR
Why is this PR needed?
The old way of plotting multiple figures with a loop created a separate scene for each subplot, which can cause a segmentation fault if the reference to each scene isn't kept.
What does this PR do?
This PR improves the API for plotting multiple 2D slices from the same dataset at different distances
References
issue #54
How has this PR been tested?
pytest and running examples
Is this a breaking change?
no
Does this PR require an update to the documentation?
no
Checklist: