Sha256: 43bb9956198ec4d74b49aba1e85d6d0106625783f02596663cd21d95ec210f31

Contents?: true

Size: 510 Bytes

Versions: 6

Compression:

Stored size: 510 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

6 entries across 6 versions & 2 rubygems

Version Path
gsl-2.1.0.3 examples/histogram/cauchy.rb
gsl-2.1.0.2 examples/histogram/cauchy.rb
gsl-2.1.0.1 examples/histogram/cauchy.rb
gsl-2.1.0 examples/histogram/cauchy.rb
gsl-1.16.0.6 examples/histogram/cauchy.rb
rb-gsl-1.16.0.5 examples/histogram/cauchy.rb