Debian Codegraph @

tools/tests/inline_figshow.py

raw
1 """Manual test for figure.show() in the inline matplotlib backend.
2
3 This script should be loaded for interactive use (via %load) into a qtconsole
4 or notebook initialized with the inline backend.
5
6 Expected behavior: only *one* copy of the figure is shown.
7
8
9 For further details:
10 https://github.com/ipython/ipython/issues/1612
11 https://github.com/matplotlib/matplotlib/issues/835
12 """
13
14 import numpy as np
15 import matplotlib.pyplot as plt
16
17 plt.ioff()
18 x = np.random.uniform(-5, 5, size=(100))
19 y = np.random.uniform(-5, 5, size=(100))
20 f = plt.figure()
21 plt.scatter(x, y)
22 plt.plot(y)
23 f.show()