Method: Nyaplot::Plot3D#add

Defined in:
lib/nyaplot3d/plot3d.rb

#add(type, *data) ⇒ Object

Add diagram with Array

Examples:

plot.add(:surface, [0,1,2], [0,1,2], [0,1,2])

Parameters:

  • type (Symbol)

    the type of diagram to add

  • *data (Array<Array>)

    array from which diagram is created

[View source]

25
26
27
28
# File 'lib/nyaplot3d/plot3d.rb', line 25

def add(type, *data)
  df = DataFrame.new({x: data[0], y: data[1], z: data[2]})
  return add_with_df(df, type, :x, :y, :z)
end