Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35d70d8

Browse files
committed
wrapped candlestick2 to have new argument order
1 parent ffb2074 commit 35d70d8

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

lib/matplotlib/finance.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,33 @@ def plot_day_summary_ohlc(ax, opens, highs, lows, closes, ticksize=4,
512512
ax.add_collection(closeCollection)
513513
return rangeCollection, openCollection, closeCollection
514514

515+
def candlestick_ochl(ax, opens, closes, highs, lows, width=4,
516+
colorup='k', colordown='r',
517+
alpha=0.75,
518+
):
519+
"""
520+
521+
Represent the open, close as a bar line and high low range as a
522+
vertical line.
523+
524+
Preserves the original argument order.
525+
526+
ax : an Axes instance to plot to
527+
width : the bar width in points
528+
colorup : the color of the lines where close >= open
529+
colordown : the color of the lines where close < open
530+
alpha : bar transparency
531+
532+
return value is lineCollection, barCollection
533+
"""
534+
535+
candlestick_ohlc(ax, opens, closes, highs, lows, width=width,
536+
colorup=colorup, colordown=colordown,
537+
alpha=alpha)
538+
539+
candlestick2 = candlestick_ochl
515540

516-
def candlestick2(ax, opens, highs, lows, closes, width=4,
541+
def candlestick_ohlc(ax, opens, highs, lows, closes, width=4,
517542
colorup='k', colordown='r',
518543
alpha=0.75,
519544
):

0 commit comments

Comments
 (0)