/usr/share/doc/ruby-gsl/examples/gallery/rgplot/cossin.rb is in ruby-gsl 2.1.0.3+dfsg1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #!/usr/bin/env ruby
#begin
# require 'rubygems'
# require_gem "gnuplot" # Try using rubygem
#ensure
require 'gnuplot' # No gem, use traditional require
#end
require "gsl"
# Add the to_gplot method to Vector since its not already built in. This
# might be worthwhile adding to the core GSL stuff.
x = GSL::Vector.linspace(0, 2*M_PI, 100)
s = Sf::sin(x)
c = Sf::cos(x)
# Now generate the actual plot
Gnuplot::open do |gp|
Gnuplot::Plot.new( gp ) do |plot|
plot.title "GSL plotting example"
plot.data = [
Gnuplot::DataSet.new( [x, c] ) { |ds|
ds.title = "cos(x)"
ds.with = "lines"
},
Gnuplot::DataSet.new( [x, s] ) { |ds|
ds.title = "sin(x)"
ds.with = "lines"
}
]
end
end
|