How to plot data by c program?

前端 未结 6 1918
攒了一身酷
攒了一身酷 2020-12-24 12:40

I am a mechanical engineer who has only limited knowledge in C programming. I wrote some code in order to make simulations, and I want to visualize the simulation results. A

6条回答
  •  一整个雨季
    2020-12-24 13:37

    OK, one solution, as you are writing out to a file, would be to just make a system() call when you write out to the file, and call gnuplot.

    But, that means you should change the filename each time, but I fear if you do that that it won't look correct, since you are sending small amounts of data each time.

    http://www.gnu.org/software/libc/manual/html_node/System-Calls.html

    I have never used gnuplot, but if you look at this page (http://gnuplot-tricks.blogspot.com/) you may find some tricks that would enable this to work well.

    But, I think, unless you are going to plot everything yourself, and skip gnuplot, then you may just need to wait, as you are.

    You may find the C interface to gnuplot may help you:

    http://ndevilla.free.fr/gnuplot/

提交回复
热议问题