我有如下代码:
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')
结果是这样一个情节:
我怎样才能使横杆跨越轴线,使它们之间没有间隙?在
使用^{} 关键字参数。因为您要每周进行一次重采样,所以设置
width=7
应该可以完成这项工作。在相关问题 更多 >
编程相关推荐