Re: how to feed gnuplot from an external script (was: Re: Systems for writing a science app front-end)
On 9/1/05, Justin Pryzby <email@example.com> wrote:
> On Sun, Aug 28, 2005 at 09:47:17AM -0500, Carlo Segre wrote:
> > While it is possible to feed gnuplot from an external script,
> Wait, how is it possible?
There are several ways.
The simplest is just feed some commands to gnuplot's stdin from a
script "./script | gnuplot". Another is to open a pipe to the gnuplot
process from your code. There are several libraries that hide this
procedure behind an API. The gnuplot_i library is one example
implemented in C. The last option is to simply dump all the plot
commands into a file, say "plotcmd.gp" and run "gnuplot plotcmd.gp".
It is also possible to fee data to gnuplot inline from the standard
input using '-' as the filename.