I am monitoring the serial port and attempting to plot data in Matplotlib as it arrives. Because the data arrives at irregular intervals, I am using an approach to append data - similar to this thread.
Here is my code:
data = np.zeros(shape=(1,1), dtype=[('millis',float),('temperature_Celsius',float),('relative_humidity',float),('setpoint',float),('relay_status',float)])
print data # gives a 1-row, 5-element tuple: [[(0.0, 0.0, 0.0, 0.0, 0.0)]]
# append the new row
# throws error regarding array dimensions
data = np.vstack(( data, [(1,2,3,4,5)] ))
I am having trouble getting the dimensioning right, as I get the following error:
ValueError: all the input array dimensions except for the concatenation axis must match exactly
Please help to identify the syntax error.
Running on Python 2.6, Numpy 1.8, Windows 7.