Add diagram with DataFrame
df = Nyaplot::DataFrame.new({x: [0,1,2], y: [0,1,2], z: [0,1,2]}) plot.add(df, :surface, :x, :y, :z)
Parameters:
from which diagram is created
the type of diagram to add
column labels for x, y or some other dimension
37 38 39 40 41 42
# File 'lib/nyaplot3d/plot3d.rb', line 37 def add_with_df(df, type, *labels) diagram = Diagram3D.new(df, type, labels) diagrams = get_property(:diagrams) diagrams.push(diagram) return diagram end