Class LinePlot


public class LinePlot extends Plot
Line plot is a special scatter plot which connects points by straight lines.
  • Constructor Details

    • LinePlot

      public LinePlot(Line... lines)
      Constructor.
      Parameters:
      lines - the lines.
    • LinePlot

      public LinePlot(Line[] lines, Legend[] legends)
      Constructor.
      Parameters:
      lines - the lines.
      legends - the legends of lines.
  • Method Details

    • legends

      public Optional<Legend[]> legends()
      Description copied from class: Plot
      Returns the optional legend of shape.
      Overrides:
      legends in class Plot
      Returns:
      the optional legend of shape
    • figure

      public Figure figure()
      Description copied from class: Plot
      Returns a figure containing the plot.
      Overrides:
      figure in class Plot
      Returns:
      a figure containing the plot.
    • getLowerBound

      public double[] getLowerBound()
      Description copied from class: Plot
      Returns the lower bound of data.
      Specified by:
      getLowerBound in class Plot
      Returns:
      the lower bound of data.
    • getUpperBound

      public double[] getUpperBound()
      Description copied from class: Plot
      Returns the upper bound of data.
      Specified by:
      getUpperBound in class Plot
      Returns:
      the upper bound of data.
    • paint

      public void paint(Renderer g)
      Description copied from class: Shape
      Draws the shape.
      Specified by:
      paint in class Shape
      Parameters:
      g - the renderer.
    • of

      public static LinePlot of(double[][] data)
      Creates a line plot.
      Parameters:
      data - the lines.
      Returns:
      the line plot.
    • of

      public static LinePlot of(double[][] data, Line.Style style)
      Creates a line plot.
      Parameters:
      data - the lines.
      style - the line style.
      Returns:
      the line plot.
    • of

      public static LinePlot of(double[][] data, Color color)
      Creates a line plot.
      Parameters:
      data - the lines.
      color - the line color.
      Returns:
      the line plot.
    • of

      public static LinePlot of(double[][] data, Line.Style style, Color color)
      Creates a line plot.
      Parameters:
      data - the lines.
      style - the line style.
      color - the line color.
      Returns:
      the line plot.
    • of

      public static LinePlot of(double[][] data, Line.Style style, Color color, String label)
      Creates a line plot.
      Parameters:
      data - the lines.
      style - the line style.
      color - the line color.
      label - the line legend.
      Returns:
      the line plot.
    • of

      public static LinePlot of(double[] y)
      Creates a line plot with the index as the x coordinate.
      Parameters:
      y - the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.
      Returns:
      the line plot.
    • of

      public static LinePlot of(double[] y, Line.Style style)
      Creates a line plot with the index as the x coordinate.
      Parameters:
      y - the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.
      style - the line style.
      Returns:
      the line plot.
    • of

      public static LinePlot of(double[] y, Color color)
      Creates a line plot with the index as the x coordinate.
      Parameters:
      y - the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.
      color - the line color.
      Returns:
      the line plot.
    • of

      public static LinePlot of(double[] y, Line.Style style, Color color)
      Creates a line plot with the index as the x coordinate.
      Parameters:
      y - the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.
      style - the line style.
      color - the line color.
      Returns:
      the line plot.
    • of

      public static LinePlot of(double[] y, Line.Style style, Color color, String label)
      Creates a line plot with the index as the x coordinate.
      Parameters:
      y - the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.
      style - the line style.
      color - the line color.
      label - the line legend.
      Returns:
      the line plot.