lib/gnuplotrb/plot.rb
##
# Updates existing Plot object by inserting given datasets
# into dataset list before given position (position = 0 by default).
#
# @param position [Integer] position of dataset BEFORE which datasets will be placed.
#   0 by default.
# @param *datasets [ Sequence of Dataset or Array] datasets to insert
# @example
#   sinx = Plot.new('sin(x)')
#   sinx.add!(['cos(x)'], ['exp(x)'])
#   # sinx IS affected
Updates existing Plot object by inserting given datasets
into dataset list before given position (position = 0 by default).
Updates existing Plot object by inserting given datasets into dataset list before given position ( position = 0 by default ) .
def add_datasets!(*datasets)
      datasets.map! { |ds| ds.is_a?(Numeric) ? ds : dataset_from_any(ds) }
      datasets.unshift(0) unless datasets[0].is_a?(Numeric)
      @datasets = @datasets.insert(*datasets)
      self
    end
def add_datasets! ( * datasets ) datasets . map! { | ds | ds . is_a? ( Numeric ) ? ds : dataset_from_any ( ds ) } datasets . unshift ( 0 ) unless datasets [ 0 ] . is_a? ( Numeric ) @datasets = @datasets . insert ( * datasets ) self end
Updates existing Plot object by inserting given datasets
into dataset list before given position (position = 0 by default).
Updates existing Plot object by inserting given datasets into dataset list before given position ( position = 0 by default ) .
# first element is position where to add datasets
datasets
<not_specific>
position
<not_specific>
position of dataset BEFORE which datasets will be placed. 0 by default.
position of dataset BEFORE which datasets will be placed . 0 by default .
*datasets
<not_specific>
datasets to insert
datasets to insert
example
None