Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # see image: http://imgur.com/a/HRnch
- #
- import matplotlib.pyplot as plt
- y = list(range(10))
- x1 = [a**2 for a in y]
- x2 = [a**3 for a in y]
- plt.subplot('241')
- plt.plot(x1, y, label='x^2')
- plt.plot(x2, y, label='x^3')
- plt.legend()
- plt.title('X,Y')
- plt.subplot('242')
- plt.plot(x1, y, label='x^2')
- plt.plot(x2, y, label='x^3')
- plt.legend()
- plt.gca().invert_xaxis()
- plt.title('X,Y (invert X)')
- plt.subplot('243')
- plt.plot(x1, y, label='x^2')
- plt.plot(x2, y, label='x^3')
- plt.legend()
- plt.gca().invert_yaxis()
- plt.title('X,Y (invert Y)')
- plt.subplot('244')
- plt.plot(x1, y, label='x^2')
- plt.plot(x2, y, label='x^3')
- plt.legend()
- plt.gca().invert_xaxis()
- plt.gca().invert_yaxis()
- plt.title('X,Y (invert X and Y)')
- plt.subplot('245')
- plt.plot(y, x1, label='x^2')
- plt.plot(y, x2, label='x^3')
- plt.legend()
- plt.title('Y,X')
- plt.subplot('246')
- plt.plot(y, x1, label='x^2')
- plt.plot(y, x2, label='x^3')
- plt.legend()
- plt.gca().invert_xaxis()
- plt.title('Y,X (invert X)')
- plt.subplot('247')
- plt.plot(y, x1, label='x^2')
- plt.plot(y, x2, label='x^3')
- plt.legend()
- plt.gca().invert_yaxis()
- plt.title('Y,X (invert Y)')
- plt.subplot('248')
- plt.plot(y, x1, label='x^2')
- plt.plot(y, x2, label='x^3')
- plt.legend()
- plt.gca().invert_xaxis()
- plt.gca().invert_yaxis()
- plt.title('Y,X (invert X and Y)')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement