require "rubygems" gem "nyaplot", "0.2.0.rc1" $DEBUG_NYAPLOT = true require 'nyaplot' include Nyaplot p1 = Plot.add(:scatter, x: [1,2,3], y: [3,-2, 4]) 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 p2 = Plot.from(df).add(:scatter, x: :x, y: :y).shape_by(:name) p3 = Plot.from(df).add(:line, x: :x, y: :y).width(1000) rows(columns(p1, p2), p3)