Forum: Ruby Re: Calling plotutils from xemacs using Ruby GSL

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-03-12 15:41
(Received via mailing list)
Sorry, I actually wanted to say something else in my last mail,
letting you try

> ruby rnd3.rb | graph -Tps > g.ps ,

which works out for me. It sends the results from ruby to the  external
GNU program "graph" , which is part of the plotutils package.
I can then open the file g.ps with ghostscript (gv,ggv or whatever).

The errors

NameError: uninitialized constant RND etc..

you reported come from the fact that Ruby does not know what these
constants
are, and after some digging into the description of rb-gsl, I found
out that there are two ways of requiring rb-gsl,

require "rbgsl" or require "gsl",

one of these forms lets you drop everything before the '::' , so you
can
use

a=dir_2d(r)

instead of

a = RND::dir_2d(r) .

Maybe the author changed his mind on which form of require to  associate
with which form in between...

But I still am not able to run the first program you posted, either,
where I also get the error

graph([x,y], [roots.real,zero], "-T X -C -g 3 -S 4")
NoMethodError: GNU  plotutils required
from (irb):7:in `graph'
from (irb):7

you reported. I do not know how to fix this directly, but for  me,  it
worked
out to patch that by piping the results of a ruby program into graph  as
above.

Sorry I can't help any further -maybe more experienced users of
plotting
with plotutils under rb-gsl are willing to help out ?

Best regards,

Axel
This topic is locked and can not be replied to.