Skip to content

Instantly share code, notes, and snippets.

@alexpieper
Created July 17, 2021 19:37
Show Gist options
  • Save alexpieper/766be84a47e377a959391c073a03a1e6 to your computer and use it in GitHub Desktop.
Save alexpieper/766be84a47e377a959391c073a03a1e6 to your computer and use it in GitHub Desktop.
data.index = pd.DatetimeIndex(data.index)
fig, ax = plt.subplots(2, 1, sharex = True, figsize = (15,7))
ax[0].plot(data["30d_sentiment"], label = "30 day average")
ax[0].plot(data["90d_sentiment"], label = "90 day average")
ax[1].plot(data["price"].ffill(limit = 5), color = "black")
ax[0].set_title("Sentiment")
ax[1].set_title("AAPL Stock price")
ax[0].legend()
fig.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment