matplotlib datetime xlabel issue

后端 未结 3 1884
离开以前
离开以前 2021-02-20 15:19

I\'m seeing some strange behavior in the x-axis auto-labeling for dates in matplotlib. When I issue the command:

from datetime import datetime as dt
plot( [ dt(2         


        
3条回答
  •  时光说笑
    2021-02-20 15:47

    You need to reset locator.MAXTICKS to a larger number to avoid error: exceeds Locator.MAXTICKS * 2 (2000)

    for example:

        alldays = DayLocator()              # minor ticks on the days
        alldays.MAXTICKS = 2000
    

提交回复
热议问题