Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy
- import matplotlib.pyplot as plt
- from pylab import *
- plt.style.use("classic")
- x = numpy.arange(-0.5, 0.5, 0.05)
- y1 = x
- y2 = []
- y3 = []
- for i in x:
- y2.append(numpy.sin(i))
- for i in x:
- y3.append(numpy.tan(i))
- fig, ax = plt.subplots()
- ax.plot(x,y1, "-b", label="y=x")
- ax.plot(x,y2, "-g", label="y=sin(x)")
- ax.plot(x,y3, "-r", label="y=tan(x)")
- ax.axis("equal")
- leg = ax.legend()
- plt.show()
- plt.savefig("wykres.pdf")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement