Я использую panda и matplotlib.С помощью какого-то цвета я бы хотел заполнить пространство между моей осью X и ценой (иначе говоря, закрытием).Как бы я пошел по этому поводу?Я начинающий с питоном.
import datetime as dt
import pandas_datareader.data as web
import matplotlib.pyplot as plt
import pandas as pd
# Defining Axis
fig = plt.figure()
ax1 = plt.subplot2grid((1,1), (0,0))
# Data Section
start = dt.datetime(2017,1,1)
end = dt.datetime(2018,1,1)
sp500 = web.DataReader("TSLA", "yahoo", start, end)
close = sp500['Adj Close']
# Axis Settings Section
ax1.fill_between(start, close, 0, color='grey') #here is where I'm having issues. I think the issues im having partly involve the fact that im dealing with a range of dates
ax1.plot(close, label = 'price')
ax1.grid(True, color= 'lightgreen', linestyle= '-')
ax1.xaxis.label.set_color('dodgerblue')
ax1.yaxis.label.set_color('indianred')
ax1.set_yticks([0,100,200,300,400])
# Graph/Chart Settings
plt.xlabel('Date')
plt.ylabel('Price')
plt.legend()
plt.xticks(rotation=45)
plt.subplots_adjust(left=0.09, bottom=0.20, top=0.90, wspace=0.20, hspace=0.0)
plt.show()