Using Datetimes with Seaborn's Regplot

后端 未结 1 436
情话喂你
情话喂你 2020-12-31 13:55

I\'m working in Jupyter/IPython to plot an amount of Words per Day, but am having trouble using datetimes with Regplot in Seaborn. Regplot by itself apparently does not supp

相关标签:
1条回答
  • 2020-12-31 14:51

    You can get the values of the timestamps at the locations of the xticks, and then convert them to your desired format.

    ax = plt.gca()
    xticks = ax.get_xticks()
    xticks_dates = [datetime.datetime.fromtimestamp(x).strftime('%Y-%m-%d %H:%M:%S') for x in xticks]
    ax.set_xticklabels(xticks_dates)
    
    0 讨论(0)
提交回复
热议问题