There was a need to create an automatically collected report and ran into a problem: in the charts under the X axis, you need to set the date value. However, simply inserting an array with the date, the error is: ValueError: could not convert string to float: 'Jan 03:00:02' If I write an explicit conversion plt.plot(str(gprs_data), gx1) then the error is: ValueError: x and y must have same first dimension, but have shapes (1,) and (2,) I watched some posts where it was proposed to replace the axis values ​​with some lines, but this is not appropriate, because the number of points and the date change. Here is a piece of code:

  fig = plt.figure() # Π³Ρ€Π°Ρ„ΠΈΠΊΠΈ измСнСния ΠΏΡ€ΠΎΠ΅ΠΊΡ†ΠΈΠΉ ускорСния ΠΏΠΎ 3 осям plt.subplot(321) plt.plot(str(x), y) plt.title('АксСлСромСтр(x)') plt.xticks(fontsize='6',rotation= 60) plt.yticks(fontsize='10') plt.grid() 

    1 answer 1

    You try to insert strings instead of numbers, so he swears

    ValueError: could not convert string to float: 'Jan 03:00:02'.

    Then you try to do about the same thing and build a drawing. In theory, you need to either translate these dates into seconds, and then match the marks on the axis in seconds. Or use the pandas library to work with time series.