用mpl_finance的candlestick_ohlc方法画出K线图,并用matplotlib画出成交量的柱状图?不知道是不是你想要的效果
import pandas as pd
import matplotlib.pyplot as plt
from mpl_finance import candlestick_ohlc
import matplotlib.dates as mdates
......
fig, ax = plt.subplots()
candlestick_ohlc(ax, df.values, width=0.6, colorup='g', colordown='r', alpha=0.8)
plt.bar(df['Date'], df['Volume'], color='blue', width=0.6, alpha=0.3)
plt.show()


雷达卡




京公网安备 11010802022788号







