Advertisement
furas

Python - matplotlib flip/invert plot #1

Mar 25th, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. #
  2. # see image: http://imgur.com/aTKwLrr
  3. #
  4. # see another example: http://pastebin.com/RH76YYGn
  5. #
  6.  
  7. import matplotlib.pyplot as plt
  8.  
  9. y = list(range(10))
  10. x1 = [a**2 for a in y]
  11. x2 = [a**3 for a in y]
  12.  
  13. plt.subplot('121')
  14. plt.plot(x1, y)
  15. plt.plot(x2, y)
  16.  
  17. plt.subplot('122')
  18. plt.plot(y, x1)
  19. plt.plot(y, x2)
  20. plt.gca().invert_yaxis()
  21.  
  22. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement