2D real-time plot with C [closed]
I've just recently begun programming in C. I currently have an application that read's in values from a COM port and write them to a file. It reads about 500 data points per second. I want to be able to compute a real-time 2D plot of the dat开发者_运维问答a points with respect to time. Can someone please point me in the right direction?
I've tried to post-process the data in Excel and the built in capabilities allow me to get a great graph. However, I would just like something that is computed in real-time rather than post processing it. I am using Windows XP.
Thanks in advance !
You can use KST to plot your graphs in real time. You can probably keep your existing application as is (I assume you are writing to a CSV file if you are reading it in Excel) as KST will read the data from the file as it gets updated, and update its chart.
Here are some options for you to explore:
- You can use OpenGL and in particular, GLUt. I have some C code for this if you are interested.
- You can pipe commands to gnuplot.
- You can use GNU Octave from a C/C++ program. You can read more about this here.
- You can create your own bitmaps in real-time of you graphs. This isn't as hard as it sounds.
精彩评论