[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Ruby-Gnuplot problem (using Cygwin

Nuralanur

6/12/2005 7:42:00 PM

Hello,

I'm still confused about Ruby and Gnuplot.
Without using rgnuplot, just by invoking gnuplot,

#!/usr/local/bin/ruby
gp=IO.popen("gnuplot","w");
gp.puts 'plot x**2';
sleep 1;
gp.puts 'plot [-2:2] x**3';
sleep 1;
gp.close;

I still get that warning about how insecure the world is,
but I see a plot and the program executes.

Does anybody have an installation of rgnuplot - does the following
code produce a plot correctly with you:

require "gplot/Gnuplot.rb"

plot=Gnuplot::Plot.new
plot.terminal 'postscript eps'
plot.output 'demo1.eps'

x=(1..100).to_a
y=x.collect{|i| i*i}
ds=y.gpds

plot.draw ds

(That's example No.1 from the manual coming with the rgnuplot.)
I'd very much like to be able to use Ruby's interface for gnuplot.
Thanks very much in advance.

Best regards,

Axel