code: public LinePlot line(String id, double[] y) {
          double[] lowerBound = {0, Math.min(y)};
          double[] upperBound = {y.length, Math.max(y)};
          extendBound(lowerBound, upperBound);
  
          double[][] data = new double[y.length][2];
          for (int i = 0; i < data.length; i++) {
              data[i][0] = i;
              data[i][1] = y[i];
          }
  
          LinePlot plot = new LinePlot(data);
          plot.setID(id);
          add(plot);
  
          return plot;
      }
docs: Adds a poly line plot to this canvas.
  @param id the id of the plot.
  @param y a data vector that describes y coordinates of points. The x
  coordinates will be [0, n), where n is the length of y.