This notebook describes the plots you can make with Gruff in Daru.
require 'daru'
true
Lets change the plotting library to Gruff.
Daru.plotting_library = :gruff
:gruff
dv = Daru::Vector.new [1, 2, 3]
Daru::Vector(3) | |
---|---|
0 | 1 |
1 | 2 |
2 | 3 |
dv.plot do |p|
p.title = 'lol'
end
dv.plot type: :pie
dv.plot type: :line
dv.plot type: :scatter
dv = Daru::Vector.new [:a, :a, :a, :b, :b, :b, :c, :c], type: :category
Daru::Vector(8) | |
---|---|
0 | a |
1 | a |
2 | a |
3 | b |
4 | b |
5 | b |
6 | c |
7 | c |
dv.plot
dv.plot type: :bar, method: :fraction
dv.plot type: :pie do |p|
p.title = 'category plot'
end