Class ScatterPlot


public class ScatterPlot extends Plot
The data is displayed as a collection of points.
  • Constructor Details

    • ScatterPlot

      public ScatterPlot(Point... points)
      Constructor.
    • ScatterPlot

      public ScatterPlot(Point[] points, Legend[] legends)
      Constructor.
  • Method Details

    • paint

      public void paint(Graphics g)
      Description copied from class: Shape
      Draws the shape.
      Specified by:
      paint in class Shape
    • 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
    • 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
    • of

      public static ScatterPlot of(double[][] points)
      Create a scatter plot.
      Parameters:
      points - an n-by-2 or n-by-3 matrix that describes coordinates of n points.
    • of

      public static ScatterPlot of(double[][] points, Color color)
      Create a scatter plot.
      Parameters:
      points - an n-by-2 or n-by-3 matrix that describes coordinates of n points.
    • of

      public static ScatterPlot of(double[][] points, char mark)
      Create a scatter plot.
      Parameters:
      points - an n-by-2 or n-by-3 matrix that describes coordinates of n points.
    • of

      public static ScatterPlot of(double[][] points, char mark, Color color)
      Create a scatter plot.
      Parameters:
      points - an n-by-2 or n-by-3 matrix that describes coordinates of n points.
    • of

      public static ScatterPlot of(double[][] x, String[] y, char mark)
      Creates a scatter plot of multiple groups of data.
      Parameters:
      x - the data points. The elements should be of dimension 2 or 3.
      y - the group label of data points.
    • of

      public static ScatterPlot of(double[][] x, int[] y, char mark)
      Creates a scatter plot of multiple groups of data.
      Parameters:
      x - the data points. The elements should be of dimension 2 or 3.
      y - the group label of data points.
    • of

      public static ScatterPlot of(DataFrame data, String x, String y, char mark, Color color)
      Creates a scatter plot from a data frame.
      Parameters:
      data - the data frame.
      x - the column as x-axis.
      y - the column as y-axis.
    • of

      public static ScatterPlot of(DataFrame data, String x, String y, String category, char mark)
      Creates a scatter plot from a data frame.
      Parameters:
      data - the data frame.
      x - the column as x-axis.
      y - the column as y-axis.
      category - the category column for coloring.
    • of

      public static ScatterPlot of(DataFrame data, String x, String y, String z, char mark, Color color)
      Creates a scatter plot from a data frame.
      Parameters:
      data - the data frame.
      x - the column as x-axis.
      y - the column as y-axis.
      z - the column as z-axis.
    • of

      public static ScatterPlot of(DataFrame data, String x, String y, String z, String category, char mark)
      Creates a scatter plot from a data frame.
      Parameters:
      data - the data frame.
      x - the column as x-axis.
      y - the column as y-axis.
      z - the column as z-axis.