Skip to content

Instantly share code, notes, and snippets.

@rdbuf
Last active April 4, 2020 23:07
Show Gist options
  • Save rdbuf/68f5d11b3e2b2054216d8d87e1e3e961 to your computer and use it in GitHub Desktop.
Save rdbuf/68f5d11b3e2b2054216d8d87e1e3e961 to your computer and use it in GitHub Desktop.
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)
@rdbuf
Copy link
Author

rdbuf commented Apr 4, 2020

Screenshot 2020-04-05 at 02 04 05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment