Skip to content

Instantly share code, notes, and snippets.

@domitry

domitry/interact.rb

Last active Aug 29, 2015
Embed
What would you like to do?
Draft version of Nyaplot v2.0
require 'nyaplot'
include Nyaplot
df = DataFrame.from_csv("hoge.csv")
df1 = df.clone
p1 = Plot.add(df1, :bar, :x, :y)
p2 = Plot.add(:scatter, x, y)
.add(:filter_x)
{|min, max|
df1 = df.select{|x| min < x && x < max}
p1.update
}.stage
.width 500
.height 400
column(p1, p2)
require 'nyaplot'
include Nyaplot
p1 = Plot.add(df, :scatter, :x, :y)
.color red
.fill_by :fill
.stage
.width 500
.height 500
p2 = Plot.add(df2, :bar, :x, ;y)
column(p1, p2).draw
require 'nyaplot'
include Nyaplot
red = Colors.Reds
Plot.add(:scatter, x, y)
.color red
.stage
.width 500
.height 500
.draw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment