I use c to program. plot them with other software like IDL or origin.

AI Thread Summary
Using C for programming and data plotting can be cumbersome when relying on external software like IDL or Origin, especially during debugging due to the need to repeatedly open files. A more efficient method suggested involves utilizing routines from "Numerical Recipes 3rd Edition," specifically the PSplot and PSpage routines, which allow for automatic graph generation in a pop-up window. Additionally, integrating gnuplot into the workflow is recommended. By writing data to a temporary file and executing gnuplot from the C program, users can streamline the plotting process, reducing the need to manually open files and enhancing debugging efficiency.
enricfemi
Messages
195
Reaction score
0
I use c to program. Usually, I write the data to files and plot them with other software like IDL or origin. but I really tired of it, since i need open a file thousands times while debug.

Is there any better method to plot the data. which methods do you use?
 
Physics news on Phys.org


Yes there is a much better way. I too have had to do the same thing until I found a solution in Numerical Recipes 3rd Edition. You will have to purchase the book or the source code but chapter 22 has a PSplot and PSpage routine that can be used to create graphs that open up automatically in a pop up window. You will need to download the GSview.exe from Ghostview also. The book is really worth the price.

Hope this helps.
 


You can write data to a file, then from your C program run a separate program to generate a graph from the file and open it in a window. I use gnuplot.
 


Get gnuplot. Learn how to run external programs from c. Make a function that writes a temp file and run gnuplot over it.
 


Thx.
 

Similar threads

Replies
2
Views
2K
Replies
8
Views
4K
Replies
2
Views
2K
Replies
1
Views
3K
Replies
1
Views
1K
Back
Top