Closed prisae closed 1 year ago
Merging #322 (48deb4b) into main (0f9fe1f) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #322 +/- ##
=======================================
Coverage 85.41% 85.41%
=======================================
Files 38 38
Lines 11420 11421 +1
=======================================
+ Hits 9754 9755 +1
Misses 1666 1666
Impacted Files | Coverage Δ | |
---|---|---|
discretize/mixins/mpl_mod.py | 72.55% <100.00%> (+0.02%) |
:arrow_up: |
Looks good to me, I'm assuming you've tested this yourself and it works well on your end too
"Have tested it" is probably a big word. It worked locally in a Python 3.11 environment, I checked with Jupyter Lab, and also that it doesn't break in IPython.
However, the fig.canvas
attribute exists always, as in other parts of the code we set
fig.canvas.mpl_connect("scroll_event", tracker.onscroll)
to listen to the scroll events. So setting
self.fig.canvas.capture_scroll = True
Should always be possible, and I cannot imagine that it has any negative side effects. It was created for this reason.
Let me know if you would prefer that I do a more thorough testing.
As reference maybe also this: https://matplotlib.org/ipympl/examples/full-example.html#comprehensive-example (9th cell from the top)
The behaviour changed with the advent of ipympl (Lab; modern Notebook), I think. Currently the scroll over a figure makes the notebook keep scrolling, so it is hard to scroll over a slicer-image through the volume.
This PR implements the fix suggested by Matplotlib (PR 235).