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

Click For Summary

Discussion Overview

The discussion revolves around methods for plotting data generated by C programming. Participants explore alternatives to writing data to files for plotting, particularly during debugging processes.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant expresses frustration with the need to open files repeatedly while debugging and seeks better plotting methods.
  • Another participant suggests using routines from Numerical Recipes 3rd Edition, specifically mentioning PSplot and PSpage, which can create graphs that open automatically in a pop-up window.
  • A different participant proposes running gnuplot from the C program to generate graphs from data files, indicating this as a viable alternative.
  • Another response reinforces the use of gnuplot, recommending the creation of a function in C that writes a temporary file and executes gnuplot on it.

Areas of Agreement / Disagreement

Participants present multiple approaches to plotting data, including using gnuplot and routines from a specific book, indicating that there is no consensus on a single best method.

Contextual Notes

Some methods rely on external software and may require additional setup, such as downloading GSview.exe for the Numerical Recipes approach or learning to run external programs from C.

Who May Find This Useful

Programmers using C who are looking for efficient ways to visualize data during development and debugging processes.

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 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K