I am new to PyQtGraph and need help plotting datetime objects on the x-axis which can easily be done with matplotlib. Any help would be appreciated.
As a simple version of what Id like to do see below where I want to plot the datetime objects displayed as the ticks on the x-axis.
The code throws an error as this cannot be done.
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import datetime
datetimes = ['2014-10-01 00:00:00', '2014-10-02 00:00:00', '2014-10-03 00:00:00']
x = [datetime.datetime.strptime(i, '%Y-%m-%d %H:%M:%S') for i in datetimes]
y = [1,2,3]
win = pg.GraphicsWindow(title = 'plotting')
p1 = win.addPlot(row=1, col=0, title = 'test')
p1.plot(x,y)
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()