2
DataFrameからpyploy.subplotsを描画するときに垂直線がありません。 データフレームのインデックスはそれを見て:matplotlibを使用してグリッドを描画するときに垂直線がありません
df_month.index
DatetimeIndex(['2016-01-31', '2016-02-29', '2016-03-31', '2016-04-30',
'2016-05-31', '2016-06-30', '2016-07-31', '2016-08-31',
'2016-09-30', '2016-10-31', '2016-11-30', '2016-12-31'],
dtype='datetime64[ns]', freq='M')
私はすべての行に対して垂直線を必要とします。
seaborn.set()
fig, axis = plt.subplots(nrows=6, sharex=True)
df_month.sum(axis=1).plot(ax=axis[0], marker = '.')
axis[0].set_title('Sum of costs')
for index, category in enumerate(df_month.columns.unique(), start=1):
df_month[category].sum(axis=1).plot(ax=axis[index], marker = '.')
axis[index].set_title(category)
plt.show()
は、(i、YMIN = 0、YMAX = 1)plt.axvlineを追加します – 2Obe