-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraph.py
32 lines (27 loc) · 810 Bytes
/
graph.py
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
32
import random
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import time
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
# xar = []
# yar = []
#overlay a picture over the plot
im = plt.imread("map1.png")
#implot = plt.imshow(im)
def animate(x, y):
#populating thr arrays with get_data func
# get_data(xar,yar)
#clearing previous line
ax1.clear()
#drawing line again wiht new data
ax1.scatter(x,y)
#making the overlay visible
implot = plt.imshow(im)
def get_data(xar,yar):
#figure out what pins the data is going to be coming form. Going to write to a file with [x,y] format, then update the xar array
xar.append(random.randrange(1200))
yar.append(random.randrange(500))
print("X Coords",xar)
print("Y Coords",yar)
print("")