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.
    • LinePlot

      public LinePlot(Line[] lines, Legend[] legends)
      Constructor.
  • Method Details

    • legends

      public Optional<Legend[]> legends()
      Description copied from class: Plot
      Returns the optional name of shape, which will be used to draw a legend outside the box.
      Overrides:
      legends in class Plot
    • canvas

      public Canvas canvas()
      Description copied from class: Plot
      Returns a canvas of the plot.
      Overrides:
      canvas in class Plot
    • getLowerBound

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

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

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

      public static LinePlot of(double[][] data)
      Creates a line plot.
    • of

      public static LinePlot of(double[][] data, Line.Style style)
      Creates a line plot.
    • of

      public static LinePlot of(double[][] data, Color color)
      Creates a line plot.
    • of

      public static LinePlot of(double[][] data, Line.Style style, Color color)
      Creates a line plot.
    • of

      public static LinePlot of(double[][] data, Line.Style style, Color color, String label)
      Creates a 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.
    • 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.
    • 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.
    • 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.
    • 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.