Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import numpy.random as rand
- print("Wait...")
- ###MAKING DATA###
- x = []
- y = []
- tmp = 10000 ###PLAY
- mintmp = 0 - tmp
- for i in range(mintmp, tmp):
- r_x = rand.randint(mintmp, tmp)
- r_y = rand.randint(mintmp, tmp)
- x.append(r_x)
- y.append(r_y)
- ###CALC DATA###
- cycle = tmp * 2
- st_x = []
- st_y = []
- for i in range(0, cycle):
- calc_x = (x[i] - y[i]) - x[i] / 2
- calc_y = (y[i] - x[i]) - y[i] / 2
- st_x.append(calc_x)
- st_y.append(calc_y)
- ###DRAW###
- scale = 10 ###PLAY
- color = 'red' ###PLAY
- alph = 0.2 ###PLAY
- plt.scatter(st_x, st_y, c=color, s=scale, alpha=alph, edgecolors='none')
- plt.show()
Add Comment
Please, Sign In to add comment