In [1]:
require 'mikon'

Out[1]:
Out[1]:
true
In [3]:
x = (1..100).to_a

Out[3]:
[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, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100]
In [5]:
y = 100.times.map{|e| rand(e)}

Out[5]:
[0.11586688829185865, 0, 1, 2, 3, 0, 2, 6, 1, 0, 4, 3, 10, 10, 4, 8, 8, 8, 8, 12, 10, 9, 2, 22, 21, 16, 23, 7, 13, 2, 17, 7, 25, 2, 7, 34, 17, 34, 18, 17, 20, 30, 39, 32, 4, 0, 26, 18, 35, 36, 2, 41, 44, 7, 13, 38, 7, 2, 28, 54, 4, 50, 12, 44, 10, 53, 9, 32, 36, 64, 6, 12, 8, 62, 54, 22, 53, 38, 72, 15, 37, 13, 69, 7, 75, 5, 62, 21, 18, 31, 82, 74, 79, 39, 60, 49, 10, 82, 94, 87]
In [7]:
df = Mikon::DataFrame.new({x: x, y: y})

Out[7]:
x y 1 0.11586688829185865 2 0.0 3 1.0 4 2.0 5 3.0 6 0.0 7 2.0 8 6.0 9 1.0 10 0.0 11 4.0 12 3.0 13 10.0 14 10.0 15 4.0 16 8.0 17 8.0 18 8.0 19 8.0 20 12.0 21 10.0 22 9.0 23 2.0 24 22.0 25 21.0 26 16.0 27 23.0 28 7.0 29 13.0 30 2.0 31 17.0 32 7.0 33 25.0 34 2.0 35 7.0 36 34.0 37 17.0 38 34.0 39 18.0 40 17.0 41 20.0 42 30.0 43 39.0 44 32.0 45 4.0 46 0.0 47 26.0 48 18.0 49 35.0 50 36.0 51 2.0 ... ... 100 87.0
In [12]:
plot = Nyaplot::Plot.new
sc = plot.add_with_df(df, :scatter, :x, :y)
plot.show

Out[12]:
In [ ]: