-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtestPlot.py
More file actions
31 lines (28 loc) · 686 Bytes
/
Copy pathtestPlot.py
File metadata and controls
31 lines (28 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
plt.ion()
fig = plt.figure()
ax = fig.add_subplot(111, aspect='equal')
counter = 0
while True:
ax.cla()
if counter % 2 == 0:
ax.add_patch(
patches.Rectangle(
(0.1, 0.1),
0.5,
0.5,
fill=False # remove background
) )
else:
ax.add_patch(
patches.Rectangle(
(0.3, 0.3),
0.7,
0.7,
fill=False # remove background
) )
counter += 1
fig.canvas.draw()
fig.canvas.flush_events()