fork download
  1. import matplotlib.pyplot as mpl
  2. import random
  3.  
  4. # Simulation bounds
  5. mpl.scatter([999, -999], [999, -999], c="black")
  6.  
  7. # Point class
  8. class Point:
  9. def __init__(self, color, x, y):
  10. self.color = color
  11. self.x = x
  12. self.y = y
  13.  
  14. mpl.scatter(x, y, color)
  15.  
  16. # Spawning
  17. points = []
  18.  
  19. ran_x = 0
  20. ran_y = 0
  21.  
  22. for i in range(1):
  23. ran_x = random.randint(-999, 999)
  24. ran_y = random.randint(-999, 999)
  25.  
  26. points.append(Point(ran_x, ran_y, "red"))
  27.  
  28. mpl.show()
Success #stdin #stdout #stderr 0.69s 55828KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
/usr/lib/python2.7/dist-packages/matplotlib/collections.py:902: RuntimeWarning: invalid value encountered in sqrt
  scale = np.sqrt(self._sizes) * dpi / 72.0 * self._factor