datasets = (1..4).map do |col|
  y = data.map { |row| row[col] }
  Dataset.new([x, y], using: '2:xtic(1)', title: titles[col], file: true)