Python 如何将SQLite日期格式转换为Matplotlib日期格式

Python 如何将SQLite日期格式转换为Matplotlib日期格式,python,sqlite,matplotlib,Python,Sqlite,Matplotlib,我有一系列SQLite日期,格式为“2014-04-03 13:50:47”。我试图绘制从SQLite数据库排序的一些数据,但日期格式与Matplotlib不兼容。有没有人会对我需要做些什么来将“2014-04-03 13:50:47”和“2014-04-03”更改为Matplotlib兼容的值提出质疑 谢谢 class performancePlot(Frame): def __init__(self, parent): Frame.__init__(self, par

我有一系列SQLite日期,格式为“2014-04-03 13:50:47”。我试图绘制从SQLite数据库排序的一些数据,但日期格式与Matplotlib不兼容。有没有人会对我需要做些什么来将“2014-04-03 13:50:47”和“2014-04-03”更改为Matplotlib兼容的值提出质疑

谢谢

class performancePlot(Frame):
    def __init__(self, parent):
        Frame.__init__(self, parent)
        self.parent = parent
        self.initPlot()


    def initPlot(self):
        baseFigure = Figure(figsize=(4, 4), dpi=100, frameon=True, edgecolor='none')
        subPlot = baseFigure.add_subplot(111)

        subPlot.plot([u'2014-04-03', u'2014-04-02', u'2014-04-01', u'2014-03-27', u'2014-03-24'], [219.0, 220.0, 218.0, 218.0, 219.0])
        subPlot.axhline(y=5, linewidth=1, color='g', linestyle='--')
        subPlot.axhline(y=5 + 2, linewidth=1, color='g', linestyle='--')
        subPlot.axhline(y=5 - 2, linewidth=1, color='g', linestyle='--')
        subPlot.axhline(y=(5 + (2 * 2)), linewidth=1, color='g', linestyle='--')
        subPlot.axhline(y=(5 - (2 * 2)), linewidth=1, color='g', linestyle='--')
        figureCanvas = FigureCanvasTkAgg(baseFigure, master=self)
        figureCanvas.show()
        figureCanvas.get_tk_widget().grid(column=0, row=0)

root = Tk()
#root.geometry("250x150+300+300")
plotTest = performancePlot(root)
plotTest2 = performancePlot(root)
plotTest3 = performancePlot(root)

plotTest.grid(column=0, row=1)
plotTest2.grid(column=1, row=1)
plotTest3.grid(column=2, row=1)
root.mainloop()

这不应该是个问题,介意发布一部分数据吗?SQL或CSV?上述日期来自SQLite数据库