2017-04-21 153 views
0

我使用matplotlib陰謀用python 3繪製燭臺圖表。有一件事看起來不像我想的那樣。它是蠟燭身體線條(見下圖)。因此,問題:用matplotlib燭臺陰謀

有沒有辦法避免他們的存在?另外,我需要保持黑色/白色的風格。

enter image description here

回答

1

如所見,例如,在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 
+0

謝謝,正是我所問的!但最後一行刪除所有的陰影,因此它應該被刪除。 – ApTinyPle

+0

所有這些都是你有的選擇。你可以選擇爲自己使用哪些。 – ImportanceOfBeingErnest