Plotting time in Python with Matplotlib

前端 未结 4 1598
忘掉有多难
忘掉有多难 2020-11-22 09:04

I have an array of timestamps in the format (HH:MM:SS.mmmmmm) and another array of floating point numbers, each corresponding to a value in the timestamp array.

Can

4条回答
  •  独厮守ぢ
    2020-11-22 09:54

    7 years later and this code has helped me. However, my times still were not showing up correctly.

    Using Matplotlib 2.0.0 and I had to add the following bit of code from Editing the date formatting of x-axis tick labels in matplotlib by Paul H.

    import matplotlib.dates as mdates
    myFmt = mdates.DateFormatter('%d')
    ax.xaxis.set_major_formatter(myFmt)
    

    I changed the format to (%H:%M) and the time displayed correctly.

    All thanks to the community.

提交回复
热议问题