I have to do realtime plotting of scan values of sensor. I am using gnuplot for this purpose. Till now, I am able to communicate to gnuplot from my c++ program. I tried some sample plots using a .DAT file and it is working. Now, My requirement is to plot last 5 values of sensor scan values in a single plot for comparing (that means I need to store 10 arrrays of data. 1 scan have two arrays X and Y).
What I am trying to do is to store the last 5 scan values in a column format in a .DAT file like this where x, y are are my two arrays for each scan.Then using the gnuplot command "plot 'filename.dat' 1:2" "plot 'filename.dat' 2:3" etc... Then I have to rewrite the file after every 5 scans.
X1 Y1 X2 Y2 X3 Y3 X4 Y4 X5 Y5
2.3 3.4 6.6 3.6 5.5 6.5 8.5 5.5 4.5 6.6
4.3 4.5 6.2 7.7 4.3 9.2 1.4 6.9 2.4 7.8
I want to just confirm before proceeding wheather this is efficient for real time processing. Also Is there any command in gnuplot to directly plot from two arrays without the use of .dat files. I did not find one in my search.
Any suggestions would be helpful.