Im plotting with pyqtgraph but I am stuck trying to represent with values that I need in the X axis:
I have a list with int values, which it was got from a xml file.
XX == [91049, 91049, 91049, 91049, 91049, 91051, 91057, 9110, 9110, 9118, 91111, 91111, 91119, 91122, 91122, 91130, 91133, 91133, 91142, 91145, 91145, 91153]
the right way to read that values is: XX[0]=9:10:49, XX[1]=9:10:49, ... , XX[n-1]==9:11:45, XX[n]=9:11:53
How can I code in order to show in the X axis the right format, it says, 9:10:49
To note that the values inside of list must be int, not string in order to plot with pyqtgraph so I can't to write down directly and pass to the function:
self.graphicsView.plot(XX,YY, pen='r', symbolBrush=(255,255,100), symbol='d', symbolPen='g')
So, there are a way to pass to the function graphicsView.plot the right format, it says: 9:10:49?
or there are another unknown-way for me?
thanks
::::::::::: UPDATE :::::::::::::::::
following the post: Show string values on x-axis in pyqtgraph
i got the error:
could not convert string to float: '9:10:49'
i changed the line to plot with:
self.graphicsView.plot(list(XXX.value()),YY, pen=(255,0,0), name='red', symbolBrush=(255,0,0), symbolPen='w')
and also code: XXX=dict(enumerate(X))
So, XXX now is a dict as follow:
{0: '9:10:49', 1: '9:10:49', 2: '9:10:49', 3: '9:10:49', 4: '9:10:49', 5: '9:10:51', 6: '9:10:57', 7: '9:11:00', 8: '9:11:00', 9: '9:11:08', 10: '9:11:11', 11: '9:11:11', 12: '9:11:19', 13: '9:11:22', 14: '9:11:22', 15: '9:11:30', 16: '9:11:33', 17: '9:11:33', 18: '9:11:42', 19: '9:11:45', 20: '9:11:45', 21: '9:11:53'}
it try to plot x axis with time values with a hr:mm:ss format but it seems that self.graphicView.plot() try to convert to float each value from the list XXX.
How can i trick to the function in order to convert ':' value as a float
Or maybe is better another kind of solution ? i am really lost