diff --git a/lib/youplot/backends/unicode_plot.rb b/lib/youplot/backends/unicode_plot.rb index 7f75c67..01c6277 100644 --- a/lib/youplot/backends/unicode_plot.rb +++ b/lib/youplot/backends/unicode_plot.rb @@ -127,11 +127,10 @@ module YouPlot def plot_xyxy(data, method1, params) headers = data.headers - series = data.series + series2 = data.series + .map { |s| s.map(&:to_f) } + .each_slice(2).to_a method2 = get_method2(method1) - series.map! { |s| s.map(&:to_f) } - series2 = series.each_slice(2).to_a - series = nil params.name ||= headers[0] if headers params.xlim ||= series2.map(&:first).flatten.minmax # why need? params.ylim ||= series2.map(&:last).flatten.minmax # why need?