Sha256: c4fcc123e69f10fdffa432b471acf66525b618401ca50714cff5c54be211a095

Contents?: true

Size: 512 Bytes

Versions: 16

Compression:

Stored size: 512 Bytes

Contents

#!/usr/bin/env ruby
# Usage from command line:
#  % gsl-randist 0 10000 cauchy 30 | ./hist1d.rb -100 100 200 

require("gsl")

if ARGV.size != 3
  puts("Usage: gsl-histogram xmin xmax n")
  puts("  Computes a histogram of the data")
  puts("  on stdin using n bins from xmin to xmax")
end

a = ARGV.shift.to_f
b = ARGV.shift.to_f
n = ARGV.shift.to_i

h = GSL::Histogram.alloc(n, a, b)

while line = STDIN.gets
  x = line.chomp.to_f
  h.increment(x)
end

h.graph("-C -g 3 -L 'gsl-randist 0 10000 cauchy 30'")


 

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
rb-gsl-1.16.0.4 examples/histogram/cauchy.rb
rb-gsl-1.16.0.3 examples/histogram/cauchy.rb
rb-gsl-1.16.0.3.rc1 examples/histogram/cauchy.rb
gsl-nmatrix-1.15.3.2 examples/histogram/cauchy.rb
gsl-nmatrix-1.15.3.1 examples/histogram/cauchy.rb
rb-gsl-1.16.0.2 examples/histogram/cauchy.rb
rb-gsl-1.16.0.1 examples/histogram/cauchy.rb
rb-gsl-1.16.0 examples/histogram/cauchy.rb
rb-gsl-1.15.3.2 examples/histogram/cauchy.rb
rb-gsl-1.15.3.1 examples/histogram/cauchy.rb
blackwinter-gsl-1.15.3.2 examples/histogram/cauchy.rb
gsl-nmatrix-1.15.3.0 examples/histogram/cauchy.rb
gsl-1.15.3 examples/histogram/cauchy.rb
gsl-1.14.7 examples/histogram/cauchy.rb
gsl-1.14.6 examples/histogram/cauchy.rb
gsl-1.14.5 examples/histogram/cauchy.rb