Sha256: 59f1cb78cbd8b79a7444cce0eed5254a9bcb1c3197a983adfe2229f402917a71

Contents?: true

Size: 691 Bytes

Versions: 6

Compression:

Stored size: 691 Bytes

Contents

#!/usr/bin/ruby
$:.unshift(File.dirname(__FILE__)+'/../lib/')
$:.unshift('/home/cdx/dev/reportbuilder/lib/')

# == Description
#
# Creating a scatterplot with statsample's Statsample::Graph::Scatterplot class.
# 
# In this example we'll demonstrate how a normally distributed Daru::Vector can
# be created using the daru and distribution gems, and how the values generated
# can be plotted very easily using the 'scatterplot' shorthand and supplying X
# and Y co-ordinates.
require 'benchmark'
require 'statsample'
n=100

Statsample::Analysis.store(Statsample::Graph::Scatterplot) do
  x=rnorm(n)
  y=x+rnorm(n,0.5,0.2)
  scatterplot(x,y)
end

if __FILE__==$0
  Statsample::Analysis.run
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
statsample-ekatena-2.0.2.1 examples/scatterplot.rb
statsample-ekatena-2.0.2 examples/scatterplot.rb
statsample-2.1.0 examples/scatterplot.rb
statsample-2.0.2 examples/scatterplot.rb
statsample-2.0.1 examples/scatterplot.rb
statsample-2.0.0 examples/scatterplot.rb