pyqtgraph, plotting time series

北慕城南 提交于 2019-12-02 01:10:53

I finally solved my problem, it was quite easy.

I just needed to initialize my plot widget that way:

    date_axis = pg.graphicsItems.DateAxisItem.DateAxisItem(orientation = 'bottom')
    self.graph = pg.PlotWidget(axisItems = {'bottom': date_axis})

and plot my data that way:

    graph.plot(x = useful_values_dict['useful_data']['data']['timestamp_dates'],
               y = useful_values_dict['useful_data']['data'][raw_header],
               pen=pg.mkPen(color=colors[count],width=1,style=QtCore.Qt.SolidLine))

with x data as an array of timestamp.

Thanks !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!