In [1]:
require "rubygems"

gem "nyaplot", "0.2.0.rc1"


Out[1]:
true

In [2]:
$DEBUG_NYAPLOT = true


Out[2]:
true

In [3]:
require 'nyaplot'
include Nyaplot


Out[3]:
Out[3]:
Object

In [4]:
p1 = Plot.add(:scatter, x: [1,2,3], y: [3,-2, 4])


Out[4]:

In [5]:
samples = Array.new(10).map.with_index{|d,i| 'cat'+i.to_s}
x=[];y=[];home=[]
10.times do
  x.push(5*rand)
  y.push(5*rand)
end
df = Nyaplot::DataFrame.new({x:x,y:y,name:samples})
df


Out[5]:
xyname
04.0484238194103484.210927404984771cat0
12.39838729664136440.9947338599167022cat1
24.1876151736557372.433216846323116cat2
34.6790188870709611.215626671171648cat3
41.2876432758205942.5304140551803034cat4
54.1900446637952054.391207230642776cat5
61.06125472643234181.8479149433242141cat6
70.61425473698792142.924421530548822cat7
82.5243775987426072.338777618229196cat8
93.5794320826877191.61809260676625cat9

In [6]:
p2 = Plot.from(df).add(:scatter, x: :x, y: :y).shape_by(:name)


Out[6]:

In [7]:
p3 = Plot.from(df).add(:line, x: :x, y: :y).width(1000)


Out[7]:

In [8]:
rows(columns(p1, p2), p3)


Out[8]:

In [ ]: