2

the mplfinance chart will only display years when the dates of the data are crossing different years (here 2014-2015) like:

enter image description here

otherwise, the dates on the chart will look like:

enter image description here

how to make the year information always be displayed on the chart?

kay
  • 147
  • 1
  • 8

1 Answers1

1

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/

Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61