ruby-numo / numo-gnuplot

Gnuplot wrapper for Ruby/Numo
BSD 3-Clause "New" or "Revised" License
51 stars 8 forks source link

`write': Broken pipe (Errno::EPIPE) #1

Closed gwmoura closed 8 years ago

gwmoura commented 8 years ago

Guys when I tried to run a script:

require 'numo/gnuplot'
require 'numo/narray'

n = 60
x = (Numo::DFloat.new(1,n).seq/n-0.5)*30
y = (Numo::DFloat.new(n,1).seq/n-0.5)*30
r = Numo::NMath.sqrt(x**2+y**2) + 1e-10
z = Numo::NMath.sin(r)/r

Numo.gnuplot do
  set title:'2D data plot'
  set dgrid3d:[60,60]
  splot z, w:'pm3d', t:'sin(r)/r'
end

This error occurred:

/usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:244:in `write': Broken pipe (Errno::EPIPE)
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:244:in `puts'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:244:in `send_cmd'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:229:in `run'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:80:in `block (2 levels) in _set_unset'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:79:in `each'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:79:in `block in _set_unset'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:76:in `each'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:76:in `_set_unset'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:65:in `set'
    from plot.rb:11:in `block in <main>'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:5:in `instance_eval'
    from /usr/local/bundle/gems/numo-gnuplot-0.1.1/lib/numo/gnuplot.rb:5:in `gnuplot'
    from plot.rb:10:in `<main>'

What's happening?

masa16 commented 8 years ago

Does 'gnuplot' command exist in your PATH? Please install Gnuplot first. Otherwise, please check the output of the next Ruby script.

p Numo::Gnuplot.new
gwmoura commented 8 years ago

Thanks @masa16! gnuplot not installed, I am using a docker container to run this script. I'm gonna install and test