Skip to content

Instantly share code, notes, and snippets.

@maxdevblock
Created December 2, 2022 12:00
Show Gist options
  • Save maxdevblock/7d7cb11665846dbcad68e1757bb6ab71 to your computer and use it in GitHub Desktop.
Save maxdevblock/7d7cb11665846dbcad68e1757bb6ab71 to your computer and use it in GitHub Desktop.
x_bar = X.sum()/X.size
y_bar = Y.sum()/Y.size
fig, ax = plt.subplots(facecolor="w")
plt.plot(X, Y, "o", label="observations")
plt.axvline(x_bar, ls="--", label=fr"$\bar{{x}}={x_bar:.2f}$", color="C1")
plt.axhline(y_bar, ls="--", label=fr"$\bar{{y}}={y_bar:.2f}$", color="C2")
plt.legend(loc="upper left", bbox_to_anchor=(1,1))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment