Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from scipy.stats import dirichlet
- from scipy.stats import beta
- import time
- a = 1
- b = 1
- c = 1
- n = 3
- A = []
- B = []
- C = []
- A.append(a / n)
- B.append(b / n)
- C.append(c / n)
- tmp = []
- tmp.append(n)
- #hostname = 'www.google.com'
- treshold1 = 10.2
- treshold2 = 14
- fig = plt.figure(23)
- ax = fig.add_subplot(111)
- fig.show()
- fig.canvas.draw()
- for i in range(100):
- X = ping(hostname)
- n += 1
- time.sleep(.01)
- if X <= treshold1:
- a += 1
- elif X <= treshold2:
- b += 1
- else:
- c += 1
- A.append(a / n)
- B.append(b / n)
- C.append(c / n)
- tmp.append(n)
- ax.stackplot(tmp, A, B, C, labels=[a,b,c], colors=['G', 'B', 'R'])
- plt.title(f'X = {X}')
- fig.canvas.draw()
- time.sleep(.1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement