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

candlestick2_ohlc plotting alignment problem

andyfcx opened this issue · comments

While using candlestick2_ohlc plotting, the starting point and the ending point are not located at the origin, left some space.

Is there any way to set the start at the origin?

2010_2011_k-plot

Assuming your first argument is the Axis object, ax, you can use

ax.margin(x=0)

or equivalently

ax.set_xmargin(0)

The default can be controlled via a matplotlibrc file, or by directly setting

plt.rcParams['axes.xmargin'] = 0