From: Sky Yin Date: 2005-12-12T05:24:03+09:00 Subject: Re: Equation graphing software? ------=_Part_21651_16021855.1134332633682 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline A ruby noob question: If I want to run an external program within ruby code (instead of running it outside like the example you gave), how can I pass a string through the pipeline to the program? Thanks On 12/9/05, Eric Lavigne wrote: > > >Does Ruby have any modules useful in graphing equations like y=3Dx**2+5, > >y**2+x**2=3D16, 4y+3x=3D28, and the like? > > gnuplot does this: http://gnuplot.info/ > Gnuplot can create your graphs as files or display them on the screen. > Gnuplot is ordinarily used as a standalone program which reads a > script, but you can make it work with your program by putting gnuplot > at the end of a pipeline. Your program writes gnuplot commands to > standard-out: > > ruby myprog.rb | gnuplot > > If you need to do something more complicated (or if your OS doesn't > support pipes), creating an object that acts as an output stream to a > gnuplot process would be fairly easy. > > > ------=_Part_21651_16021855.1134332633682--