matplotlib / mpl-finance

This package is DEPRECATED, replaced by https://github.com/matplotlib/mplfinance

Home Page:https://pypi.org/project/mplfinance/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong default width for candlestick2_ohlc( ) function and something else.

BruceDai003 opened this issue · comments

commented

Issue 1
Hello, I'm new to github and python. But I just read the source code of mpl_finance.py, and found that in the function
def candlestick2_ohlc(ax, opens, highs, lows, closes, width=4, colorup='k', colordown='r', alpha=0.75, ):
the width should probably be 0.4, right? Otherwise the bars will be overlapped.

Issue 2
Also inside this function definition,
rangeCollection = LineCollection(rangeSegments, colors=((0, 0, 0, 1), ), linewidths=lw, antialiaseds=useAA, )
This is the plot of the vertical lines of the candlesticks. But I think the colors shouldn't be black, instead setting colors = colors would be more sensible, right?

Issue 3

In the other 3 functions similar to this, which are
def candlestick2_ochl(ax, opens, closes, highs, lows, width=4, colorup='k', colordown='r', alpha=0.75, ):

def plot_day_summary2_ochl(ax, opens, closes, highs, lows, ticksize=4, colorup='k', colordown='r', ):
and
def plot_day_summary2_ohlc(ax, opens, highs, lows, closes, ticksize=4, colorup='k', colordown='r', ):
shouldn't the width and ticksize parameters all be set to 0.4 in the same way? Another question is why colorup defaults to black color, it seems wierd to me. In China, we typically use color red for up, green/blue for down. And I remember that in US, typically the convention is color green for up, red for down. Thus, black color for moving up is strange to me.

I don't know how to use Pull request yet. But I will try.

Some of this looks like it is addressed by #5

If you need any help getting started, jumping in https://gitter.im/matplotlib/matplotlib is a good place to start.

Closed by #5