答案 0 :(得分:2)
如所见在this answer中,您可以获取烛台图表的线条和面片,并根据您的喜好更改其属性:
lines, patches = candlestick_ohlc(ax, quotes, width=0.5)
for line, patch in zip(lines, patches):
patch.set_edgecolor("k")
patch.set_linewidth(0.72)
patch.set_antialiased(False)
line.set_color("k")
line.set_zorder(0) # make lines appear behind the patches
line.set_visible(False) # make them invisible
答案 1 :(得分:0)
我开发了finplot,以获得更好的API和更高的性能。 finplot默认情况下在空心蜡烛上没有此渲染错误。
import finplot as fplt
import yfinance as yf
df = yf.download('AAPL', '2020-05-01')
ax,axv = fplt.create_plot('Apple Inc.', rows=2)
cplot = fplt.candlestick_ochl(df[['Open','Close','High','Low']], ax=ax)
vplot = fplt.volume_ocv(df[['Open','Close','Volume']], ax=axv)
cplot.colors.update(dict(bull_frame='#000', bull_body='#fff', bull_shadow='#000', bear_frame='#000', bear_body='#000', bear_shadow='#000'))
vplot.colors.update(dict(bull_frame='#000', bull_body='#fff', bear_frame='#000', bear_body='#000'))
fplt.show()