Method: SPCore::Plotter#plot_1d
- Defined in:
- lib/spcore/util/plotter.rb
#plot_1d(titled_sequences) ⇒ Object
Plot a sequence of values.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/spcore/util/plotter.rb', line 74 def plot_1d titled_sequences datasets = [] titled_sequences.each do |title, sequence| indices = Array.new(sequence.size) sequence.each_index do |i| indices[i] = i #if plot_against_fraction # indices[i] /= sequence.size.to_f #end end dataset = Gnuplot::DataSet.new( [indices, sequence] ){ |ds| ds.with = @linestyle ds.title = title ds.linewidth = @linewidth } datasets << dataset end plot_datasets datasets end |