code: public static PlotCanvas plot(String id, double[][] data, Line.Style style, Color color) {
          if (data[0].length != 2 && data[0].length != 3) {
              throw new IllegalArgumentException("Invalid data dimension: " + data[0].length);
          }
  
          double[] lowerBound = Math.colMin(data);
          double[] upperBound = Math.colMax(data);
          PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound);
  
          LinePlot plot = new LinePlot(data, style);
          plot.setID(id);
          plot.setColor(color);
          canvas.add(plot);
  
          return canvas;
      }
docs: Create a plot canvas with the poly line plot of given data.
  @param id the id of the plot.
  @param data a n-by-2 or n-by-3 matrix that describes coordinates of points.
  @param style the stroke style of line.
  @param color the color of line.