I have this sample data (I report just few rows):
date price sentiment
0 2018-09-18 0.0034 0.250000
1 2018-09-17 0.0034 0.083333
2 2018-09-16 0.0034 0.281250
3 2018-09-15 0.0035 0.096774
4 2018-09-14 0.0036 -0.039216
5 2018-09-13 0.0034 0.416667
6 2018-09-12 0.0031 0.061224
My code sample is this:
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
df = df.set_index(pd.to_datetime(df.date), drop=True)
params = {"text.color" : "black",
'figure.figsize': (13, 5),
"xtick.color" : "crimson",
"ytick.color" : "crimson"}
plt.rcParams.update(params)
fig = plt.figure()
df.price.plot(grid=True, label="Price", legend=True, color='#228B22', title='Price vs Sentiment')
df.sentiment.plot(grid=True, secondary_y=True, label="Sentiment", legend=True, color='#3D59AB')
plt.show()
I would like to crash the sentiment line in my plot in order to take a look better at the variations, maybe showing the entire range [-1;1] of the sentiment. Any suggestions? How could I improve my plot below?