5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/daru/plotting/gruff/dataframe.rb', line 5
def plot opts={}
type = opts[:type] || :bar
size = opts[:size] || 500
x = opts[:x]
y = opts[:y]
type = process_type type, opts[:categorized]
case type
when :line, :bar, :scatter
plot = send("#{type}_plot", size, x, y)
when :scatter_categorized
plot = scatter_with_category(size, x, y, opts[:categorized])
else
raise ArgumentError, 'This type of plot is not supported.'
end
yield plot if block_given?
plot
end
|