the mplfinance chart will only display years when the dates of the data are crossing different years (here 2014-2015) like:
otherwise, the dates on the chart will look like:
how to make the year information always be displayed on the chart?
the mplfinance chart will only display years when the dates of the data are crossing different years (here 2014-2015) like:
otherwise, the dates on the chart will look like:
how to make the year information always be displayed on the chart?
Use kwarg datetime_format=
when calling mpf.plot()
. So, for example, to get the format that you described above, do:
mpf.plot(df,...,datetime_format="%Y-%b-%d")
See all of the available format codes here: https://strftime.org/