require 'nyaplot'
plot = Nyaplot::Plot.new
sc = plot.add(:scatter, [0,1,2,3,4], [-1,2,-3,4,-5])
plot.show
df = Nyaplot::DataFrame.new({a: [0,1,2,3,4], b: [-1,2,-3,4,-5], type: ['a','b','a','a','b']})
sc = plot.add_with_df(df, :scatter, :a, :b)
sc.fill_by(:type)
plot.show
require 'rbplotly'
trace1 = { x: [1,2,3,4,5,6], y: [100,200,300,400,500,600] }
trace2 = { x: [1,2,3,4,5,6], y: [600,500,400,300,200,100] }
traces = [trace1, trace2]
pl = Plotly::Plot.new(data: traces)
pl.show
require 'daru'
df = Daru::DataFrame.from_csv('./O_TUKIBETSU_NENREI.csv')
require 'daru/plotly'
include Daru::Plotly::Methods # plotメソッドが使えるようになる
plot(df, x: 'age', y: 'total_count')
plot(df, x: 'age', y: ['total_count', 'male', 'female']).show
require 'pandas'
pd = Pandas
x = pd.read_csv('./O_TUKIBETSU_NENREI.csv')
p x.shape