mpl2.py 520 B

123456789101112131415161718192021222324252627
  1. import matplotlib.pyplot as plt
  2. import random
  3. xs = [random.randint(0, 100) for x in xrange(1000)]
  4. ys = [random.randint(0, 100) for x in xrange(1000)]
  5. plt.scatter(xs, ys)
  6. plt.show()
  7. '''
  8. plt.hist([1,1,1,3,3,5,8,8,10])
  9. plt.show()
  10. plt.plot([1,4,8,4,1])
  11. plt.plot([1,2,3,4,5], 'r')
  12. plt.plot([1,2,3,4,5], [6,5,4,3,1])
  13. plt.xlabel("Time (Years)")
  14. plt.ylabel("Distance (miles)")
  15. plt.title("Change in distance over Time")
  16. plt.show()
  17. plt.scatter([1,2,3,4,5], [6,5,4,3,1])
  18. plt.scatter([1,2,3,4,5], [1,2,3,4,5])
  19. plt.show()
  20. '''