Created
November 20, 2020 04:37
-
-
Save rhoit/c77b85432c81bda94a5acf0b6768dc98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
n = 100 | |
x = np.arange(n) | |
plt.plot(x, x, label='linear') | |
plt.plot(x, 2*x, label='double') | |
plt.plot(x, x*x, label='square') | |
plt.plot(x, x**3, label='power') | |
plt.grid() | |
plt.xlim(0, n) | |
plt.ylim(0, n) | |
plt.legend() | |
plt.savefig('./plt/function.png') | |
plt.show() | |
return './plt/function.png' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment