Last active
April 4, 2020 23:07
-
-
Save rdbuf/68f5d11b3e2b2054216d8d87e1e3e961 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 | |
plt.rcParams['figure.facecolor'] = '1.0' | |
plt.rcParams['figure.constrained_layout.use'] = True | |
x = np.linspace(0, 100) | |
y = x**3 | |
res = np.polyfit(x, y, deg=5) | |
f = np.poly1d(res) | |
fig, ax = plt.subplots() | |
ax.plot(x, f(x)) | |
ax.scatter(x, y) |
Author
rdbuf
commented
Apr 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment