diff --git a/lib/uplot/plot.rb b/lib/uplot/plot.rb index a740cb9..7743f63 100644 --- a/lib/uplot/plot.rb +++ b/lib/uplot/plot.rb @@ -128,10 +128,18 @@ module Uplot if series.size == 1 warn "uplot: There is only one series of input data. Please check the delimiter." warn "" + warn " Headers: \e[35m#{data.headers.inspect}\e[0m" warn " The first item is: \e[35m\"#{series[0][0]}\"\e[0m" warn " The last item is : \e[35m\"#{series[0][-1]}\"\e[0m" exit 1 end + if fmt == 'xyxy' && series.size.odd? + warn "uplot: In the xyxy format, the number of series must be even." + warn "" + warn " Number of series: \e[35m#{series.size}\e[0m" + warn " Headers: \e[35m#{data.headers.inspect}\e[0m" + exit 1 + end end end end