File: inline_figshow.py

package info (click to toggle)
ipython 8.35.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,696 kB
  • sloc: python: 42,461; sh: 376; makefile: 243
file content (23 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Manual test for figure.show() in the inline matplotlib backend.

This script should be loaded for interactive use (via %load) into a qtconsole
or notebook initialized with the inline backend.

Expected behavior: only *one* copy of the figure is shown.


For further details:
https://github.com/ipython/ipython/issues/1612
https://github.com/matplotlib/matplotlib/issues/835
"""

import numpy as np
import matplotlib.pyplot as plt

plt.ioff()
x = np.random.uniform(-5, 5, size=(100))
y = np.random.uniform(-5, 5, size=(100))
f = plt.figure()
plt.scatter(x, y)
plt.plot(y)
f.show()