Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import exp, log
- from matplotlib import pyplot as plt
- x = list()
- LIMIT = 2
- counter = LIMIT / 100
- while counter <= LIMIT:
- x.append(counter)
- counter += LIMIT / 100
- # Building the functions
- y1 = list()
- y2 = list()
- y = list()
- for element in x:
- y1.append(exp(element))
- y2.append(log(element))
- y.append(element)
- print(y1)
- print(y)
- print(y2)
- # Building the diagram
- plt.plot(x, y1, label="y1 = e^x")
- plt.plot(x, y, label="y = x")
- plt.plot(x, y2, label="y2 = lnx")
- plt.legend()
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement