[英]Fill bar plot gaps in matplotlib with pandas resampled time series data
I have some code like the follwoing MWE: 我有一些像下面的MWE的代码:
import matplotlib.pyplot as plt
import pandas as pd
from pandas_datareader import data
test_df = data.get_data_yahoo('AAPL', start='2015-10-01')
test_df = test_df.resample('W', how='sum')['Volume']
fig, ax = plt.subplots()
ax.bar(test_df.index, test_df, edgecolor='None')
Which results in a plot like this: 结果是这样的情节:
How can I make the bars span the axis so there are no gaps between them? 如何使条形图跨轴,以便它们之间没有间隙?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.