Hello,
I want to show variable in a graph , I don't have "x" only the value of y
so I thought to create an int for numbers of time I get the speed and increase it every time
I will explain
I'm reading speed senor and I want to create a speed graph
the function read the data from a known file , return and print it - this part works without any problems.
this is what I have
***
I have try to make it even more simple
I can see the max value is:
Y - 60
X - 6
so something is right :-)
Thanks ,
I want to show variable in a graph , I don't have "x" only the value of y
so I thought to create an int for numbers of time I get the speed and increase it every time
I will explain
I'm reading speed senor and I want to create a speed graph
the function read the data from a known file , return and print it - this part works without any problems.
this is what I have
import matplotlib.pyplot as plt t = 0 def GetDataFunction() global t Speed = GetData() print(f"Speed: {Speed} Km/h ") plt.plot(t, float(Speed)) t += 1 GetDataFunction() plt.show()what did I miss?
***
I have try to make it even more simple
import matplotlib.pyplot as plt t = 0 Speed = [0, 1, 3, 50, 60, 22, 30] def Function(): global t while t < len(Speed): print(t, '-', Speed[t]) plt.plot(t, Speed[t]) t += 1 Function()but I get the same result - empty graph
I can see the max value is:
Y - 60
X - 6
so something is right :-)
Thanks ,