-
Notifications
You must be signed in to change notification settings - Fork 75
Extend seq.plot() for reuse ability. (1.4) #308
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
base: master
Are you sure you want to change the base?
Conversation
|
Hi! I am not a maintainer, but just wanted to point out that v1.5.0_dev branch also has changes to plot. |
i hope that the same reuse can be done there. |
- fix grid display for clear=False - unify subplot naming and handling - removed obsolete plot_type param - fix type annotation - improve documentation
|
I did some additional refactoring in 27e3fe1 to improve the general code style and documentation and to fix the issue that the grid was removed in every second function call when using the the This PR changes the return value of the plot method from Would be great if @btasdelen and/or @FrankZijlstra and/or @mcencini could have a look at it again. I think it wouldn't be best practice if I approve this PR after all my modifications. @mzaiss could you please confirm that everything is still working for you as expected after my changes |
This PR makes seq.plot() more flexible for interactive use and debugging.
The new clear flag defaulting to True ensures behavior as previously, which is that during repeated calls the plots in figure 1 and 2 get overwritten. Now, you can set clear=False to intentionally overlay sequences in the existing plots for direct comparison, which is useful for debugging subtle differences, but also great for educational purposes.
See here for two seqs with slightly different gradients (flat_area and flat_time vs. area and duration) and a corresponding shift in the rf pulse timing in this example.
The function now returns its figure and axes objects (fig1, axes1, fig2, axes2), which allows for post-plot customization (e.g., adding titles, annotations, signal) or extracting axes.