The data of stock is like this:
date open high low close date_ori
53 735999 340.5 340.5 332.5 336.0 2016-02-05
54 736009 330.5 342.0 330.0 339.5 2016-02-15
55 736010 340.5 341.5 337.5 339.0 2016-02-16
From 2016-02-05 to 2016-02-15, there is a date gap.
Then, I have created a candlestick chart with matplotlib
fig, ax = plt.subplots(figsize=(25, 15), dpi=300)
fig.subplots_adjust(bottom=0.2)
mpf.candlestick_ohlc(ax, quotes, width=0.5, colorup='r', colordown='g')
ax.xaxis_date()
ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d'))
ax.autoscale_view()
plt.setp(plt.gca().get_xticklabels(), rotation=30)
The chart is as the following:
How to remove the gap on the chart to make the candlestick line continuous?