Sha256: 69f97e48dab3badc4a8f71905de7f7e8179b731a9c380dd846724878aac711b8

Contents?: true

Size: 636 Bytes

Versions: 22

Compression:

Stored size: 636 Bytes

Contents

#!/usr/bin/env ruby
# Turn on warnings
$-w = true

require 'irb/xmp'
require 'gsl'

# Apparently, IRB::Frame has a bug that prevents the defaults from working, so
# an XMP instance must be created explicitly this way instead of using the
# otherwise convenient xmp method.
XMP.new(IRB::Frame.top(-1)).puts <<END
# Create Vector to plot
y1 = GSL::Vector[0.2, 3, 2, 0.4, 0, 4, 0]

# Plot it using #graph()
y1.graph

# Create x and y2 Vectors
x = GSL::Vector.linspace(0, 10, 50)

y2 = GSL::Sf::bessel_J0(x)

# Plot x vs y using #graph(x)
y2.graph(x)

# Plot y1 and x vs y2 using GSL::Vector.graph
GSL::Vector.graph([nil, y1], [x, y2])
END

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
gsl-2.1.0.3 examples/vector/graph.rb
gsl-2.1.0.2 examples/vector/graph.rb
gsl-2.1.0.1 examples/vector/graph.rb
gsl-2.1.0 examples/vector/graph.rb
gsl-1.16.0.6 examples/vector/graph.rb
rb-gsl-1.16.0.5 examples/vector/graph.rb
rb-gsl-1.16.0.4 examples/vector/graph.rb
rb-gsl-1.16.0.3 examples/vector/graph.rb
rb-gsl-1.16.0.3.rc1 examples/vector/graph.rb
gsl-nmatrix-1.15.3.2 examples/vector/graph.rb
gsl-nmatrix-1.15.3.1 examples/vector/graph.rb
rb-gsl-1.16.0.2 examples/vector/graph.rb
rb-gsl-1.16.0.1 examples/vector/graph.rb
rb-gsl-1.16.0 examples/vector/graph.rb
rb-gsl-1.15.3.2 examples/vector/graph.rb
rb-gsl-1.15.3.1 examples/vector/graph.rb
blackwinter-gsl-1.15.3.2 examples/vector/graph.rb
gsl-nmatrix-1.15.3.0 examples/vector/graph.rb
gsl-1.15.3 examples/vector/graph.rb
gsl-1.14.7 examples/vector/graph.rb