I am able to plot simple graphs of sinx cosx graph using gnuplot
. But I am not able to update it in real time. By real time, I mean to say that its x-axis should change automatically. How can I do that.?
Here is the code for simple sinx plotting:
#include <stdio.h>
int main()
{
FILE *fp;
fp = popen("gnuplot -persist","w");
fprintf(fp, " plot[-5:5] sin(x)\n");
pclose(fp);
return 0;
}
This code plots a graph of sinx
with x-axis
range of -5 to 5, but how will I set the range in case of real time. How to plot a real time graph, please help, thanks.!