0

enter image description herehere is my code

y_value = self.data[header]
self.plot_widget.plot(x=x_time, y=y_value, pen=self.color_dict[header], name=header)
axis = pg.DateAxisItem(orientation='bottom')
self.plot_widget.getPlotItem().axes['bottom']['item'] = axis
tick_format = "%Y-%m-%d %H:%M:%S"  # Формат меток (Example: "2023-08-15 12:00:00")
tick_positions = [(x.timestamp(), x.strftime(tick_format)) for x in x_time]
axis.setTicks([tick_positions])

here is x_time

0    2020-05-12 16:19:00
1    2020-05-19 15:28:00
2    2020-05-26 14:53:00
3    2020-06-03 17:56:00
4    2020-06-09 16:19:00
             ...        
60   2021-12-08 15:11:00
61   2021-12-22 15:19:00
62   2021-12-29 15:31:00
63   2022-01-12 13:39:00
64   2022-01-19 16:11:00
Name: Date, Length: 65, dtype: datetime64[ns]

why do I see seconds since the beginning of the epoch on the x-axis, and not my dates in the usual format? and another question, will such a graph be dynamically scalable?

I expected to see a graph with dates and not numbers

0 Answers0