Fix plt.show() - #608
Conversation
|
Seems reasonable, but this is a test that fails on this branch but not on import matplotlib.pyplot as plt
import scipp as sc
sc.arange("x", 5.0).plot()
plt.close("all") # Should succeed; PR 608 raises AttributeError. |
|
@jokasimr I decided to just use |
|
Here's a test that AI found that passes on import matplotlib.pyplot as plt
import plopp as pp
import scipp as sc
def test_tiling_leaves_no_temporary_figures():
plt.switch_backend("WebAgg")
left = pp.tiled(1, 1)
right = sc.arange("x", 5.0).plot()
plt.close("all") # Close the inputs.
plt.close((left + right).fig) # Create and close the result.
assert plt.get_fignums() == []I've verified manually that this actually leaves a non-closed figure that is displayed the next time the user calls The issueThe issue: Difference between
Possible fixIn t = Tiled(1, 1)
t[0, 0] = other
plt.close(t.fig) # Added
other = tClosing removes the figure from pyplot and closes its window. Its contents remain Apply the same line to the temporary wrappers in |
Fixes #607