Skip to content

Instantly share code, notes, and snippets.

@FisherKK
Created July 10, 2018 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FisherKK/942fa9aaaa95be04f75a316a5824343c to your computer and use it in GitHub Desktop.
Save FisherKK/942fa9aaaa95be04f75a316a5824343c to your computer and use it in GitHub Desktop.
matplotlib.rcParams.update({'font.size': 14})
plt.figure(figsize=(8, 5))
plt.scatter(df_data["size"], df_data["price"],
edgecolor='black', linewidth='1', s=70, alpha=0.7, c="#3176f7")
plt.plot(np.arange(0, 120, 0.1), [predict([x], model_parameters_0) for x in np.arange(0, 120, 0.1)], c="red")
plt.text(55, 36, "y = 0", color="red", fontsize=12)
plt.xlabel("Size [m^2]")
plt.ylabel("Price [k zł]")
plt.ylim(-100, 1000)
plt.xlim(0, 120)
plt.title("y = wx + b, [w=0, b=0]")
plt.yticks(np.arange(0, 1000, 100))
plt.xticks(np.arange(0, 120, 10))
plt.grid(color='blue', linestyle='--', linewidth=1, alpha=0.2)
plt.gca().spines["top"].set_visible(False)
plt.gca().spines["right"].set_visible(False)
plt.gca().spines["bottom"].set_visible(False)
plt.gca().spines["left"].set_visible(False);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment