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

Skip to content

Commit 4ee6d2e

Browse files
committed
added depreciation warning + fixed error is function call argument
order
1 parent 4ab6b95 commit 4ee6d2e

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

lib/matplotlib/finance.py

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,11 +532,43 @@ def candlestick_ochl(ax, opens, closes, highs, lows, width=4,
532532
return value is lineCollection, barCollection
533533
"""
534534

535-
candlestick_ohlc(ax, opens, closes, highs, lows, width=width,
535+
candlestick_ohlc(ax, opens, highs, closes, lows, width=width,
536536
colorup=colorup, colordown=colordown,
537537
alpha=alpha)
538538

539-
candlestick2 = candlestick_ochl
539+
540+
def candlestick2(ax, opens, closes, highs, lows, width=4,
541+
colorup='k', colordown='r',
542+
alpha=0.75,
543+
):
544+
"""
545+
546+
Represent the open, close as a bar line and high low range as a
547+
vertical line.
548+
549+
Preserves the original argument order.
550+
551+
ax : an Axes instance to plot to
552+
width : the bar width in points
553+
colorup : the color of the lines where close >= open
554+
colordown : the color of the lines where close < open
555+
alpha : bar transparency
556+
557+
return value is lineCollection, barCollection
558+
"""
559+
560+
561+
warnings.warn("This function has been deprecated in 1.3 in favor"
562+
"of `candlestick_ochl`,"
563+
"which maintains the original argument order,"
564+
"or `candlestick_ohlc`,"
565+
"which uses the open-high-low-close order."
566+
"This function will be removed in 1.4", mplDeprecation)
567+
568+
569+
candlestick_ohlc(ax, opens, highs, lows, closes, width=width,
570+
colorup=colorup, colordown=colordown,
571+
alpha=alpha)
540572

541573
def candlestick_ohlc(ax, opens, highs, lows, closes, width=4,
542574
colorup='k', colordown='r',

0 commit comments

Comments
 (0)