I\'m looking to make the wick portion of a candlestick stick black using matplotlib? I couldn\'t find any mention of it in the documentation, but I\'ve seen pictoral examples sh
Rewriting the complete candlestick_ohlc
seems overly complicated. You can just iterate over the lines returned by the function and set their color to black. You may also set the zorder
to have the wicks appear below the boxes.
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)
If this is to be used often in a script, you can of course put it in a function.
def candlestick_ohlc_black(*args,**kwargs):
lines, patches = candlestick_ohlc(*args,**kwargs)
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)
candlestick_ohlc_black(ax, quotes, width=0.5)