 |
Forums |
Admin Discussion Forums: help Start New Thread
By: Yoshiki Tsunesada
RE: Graphing using plotutils interface [ reply ] 2008-07-11 01:06
|
|
Just one more thing: If the MacPort ruby libraries are at the head of the library search path, the ruby interpreter finds MacPort library first and uses it, then you will encounter the same error. I recommend to remove the MacPort rb-gsl, or delete the library files in /opt/local/lib.
|
By: Natalie Klein
RE: Graphing using plotutils interface [ reply ] 2008-07-10 23:13
|
Thank you, that makes sense. I will try building it myself and see if that works.
Just out of curiosity though, does your "graph" interface do something different than write the data to a file and then call "graph" from the shell?
|
By: Yoshiki Tsunesada
RE: Graphing using plotutils interface [ reply ] 2008-07-10 22:51
|
In order to use the graph interface, Ruby/GSL must be built in an environment that plotutils has been installed. I guess the rb-gsl package of MacPorts was compiled without plotutils. It is better to compile Ruby/GSL by yourself from the source package. It is easy to compile the source, just type
$ ruby setup.rb config
$ ruby setup.rb setup
$ sudo ruby setup.rb install
You fill see a message in the config path that the script finds the graph command to be enabled in Ruby/GSL.
|
By: Natalie Klein
Graphing using plotutils interface [ reply ] 2008-07-10 16:13
|
Hi.
I am trying to plot data generated using Ruby/GSL using GNU graph. I have plotutils installed, and I can successfully call "graph" from the command line. However, when I try to use the graphing interface provided in Ruby/GSL, it does not work. See the following example for my error message:
irb(main):001:0> require("gsl")
=> true
irb(main):002:0> x = GSL::Vector.linspace(0, 2.0*GSL::M_PI, 20)
=> GSL::Vector
[ 0.000e+00 3.307e-01 6.614e-01 9.921e-01 1.323e+00 1.653e+00 1.984e+00 ... ]
irb(main):003:0> c = GSL::Sf::cos(x)
=> GSL::Vector
[ 1.000e+00 9.458e-01 7.891e-01 5.469e-01 2.455e-01 -8.258e-02 -4.017e-01 ... ]
irb(main):004:0> s = GSL::Sf::sin(x)
=> GSL::Vector
[ 0.000e+00 3.247e-01 6.142e-01 8.372e-01 9.694e-01 9.966e-01 9.158e-01 ... ]
irb(main):005:0> GSL::Vector.graph(x,c,s,"-T X -C -L 'cos(x), sin(x)'")
NoMethodError: GNU plotutils required
from (irb):5:in `graph'
from (irb):5
I have tried multiple examples and they all fail in the same way. I'm guessing that for some reason Ruby/GSL can't see where my plotutils/graph program is installed, even though it's on the build path? I am using Mac OSX and I installed Ruby/GSL and plotutils using Macports.
I really don't know what else to try. Right now, I am just going to put the data to files and call "graph" from command line myself, but I was hoping to get your interface working at some point.
Thank you and please let me know if you need more detail.
|
|
 |