Method: GnuplotRB::Plot#update_dataset
- Defined in:
- lib/gnuplotrb/plot.rb
#update_dataset(position = 0, data: nil, **options) ⇒ Object
Create new Plot object where dataset at position will be replaced with the new one created from it by updating.
106 107 108 109 110 |
# File 'lib/gnuplotrb/plot.rb', line 106 def update_dataset(position = 0, data: nil, **) old_ds = @datasets[position] new_ds = old_ds.update(data, ) new_ds.equal?(old_ds) ? self : replace_dataset(position, new_ds) end |