public class ScatterPlot extends Plot
Constructor and Description |
---|
ScatterPlot(Point... points)
Constructor.
|
ScatterPlot(Point[] points,
Legend[] legends)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
getLowerBound()
Returns the lower bound of data.
|
double[] |
getUpperBound()
Returns the upper bound of data.
|
java.util.Optional<Legend[]> |
legends()
Returns the optional name of shape, which will be used to
draw a legend outside the box.
|
static ScatterPlot |
of(smile.data.DataFrame data,
java.lang.String x,
java.lang.String y,
char mark,
java.awt.Color color)
Creates a scatter plot from a data frame.
|
static ScatterPlot |
of(smile.data.DataFrame data,
java.lang.String x,
java.lang.String y,
java.lang.String category,
char mark)
Creates a scatter plot from a data frame.
|
static ScatterPlot |
of(smile.data.DataFrame data,
java.lang.String x,
java.lang.String y,
java.lang.String z,
char mark,
java.awt.Color color)
Creates a scatter plot from a data frame.
|
static ScatterPlot |
of(smile.data.DataFrame data,
java.lang.String x,
java.lang.String y,
java.lang.String z,
java.lang.String category,
char mark)
Creates a scatter plot from a data frame.
|
static ScatterPlot |
of(double[][] points)
Create a scatter plot.
|
static ScatterPlot |
of(double[][] points,
char mark)
Create a scatter plot.
|
static ScatterPlot |
of(double[][] points,
char mark,
java.awt.Color color)
Create a scatter plot.
|
static ScatterPlot |
of(double[][] points,
java.awt.Color color)
Create a scatter plot.
|
static ScatterPlot |
of(double[][] x,
int[] y,
char mark)
Creates a scatter plot of multiple groups of data.
|
static ScatterPlot |
of(double[][] x,
java.lang.String[] y,
char mark)
Creates a scatter plot of multiple groups of data.
|
void |
paint(Graphics g)
Draws the shape.
|
public ScatterPlot(Point... points)
public java.util.Optional<Legend[]> legends()
Plot
public double[] getLowerBound()
Plot
getLowerBound
in class Plot
public double[] getUpperBound()
Plot
getUpperBound
in class Plot
public static ScatterPlot of(double[][] points)
points
- a n-by-2 or n-by-3 matrix that describes coordinates of n points.public static ScatterPlot of(double[][] points, java.awt.Color color)
points
- a n-by-2 or n-by-3 matrix that describes coordinates of n points.public static ScatterPlot of(double[][] points, char mark)
points
- a n-by-2 or n-by-3 matrix that describes coordinates of n points.public static ScatterPlot of(double[][] points, char mark, java.awt.Color color)
points
- a n-by-2 or n-by-3 matrix that describes coordinates of n points.public static ScatterPlot of(double[][] x, java.lang.String[] y, char mark)
x
- the data points. The elements should be of dimension 2 or 3.y
- the group label of data points.public static ScatterPlot of(double[][] x, int[] y, char mark)
x
- the data points. The elements should be of dimension 2 or 3.y
- the group label of data points.public static ScatterPlot of(smile.data.DataFrame data, java.lang.String x, java.lang.String y, char mark, java.awt.Color color)
data
- the data frame.x
- the column as x-axis.y
- the column as y-axis.public static ScatterPlot of(smile.data.DataFrame data, java.lang.String x, java.lang.String y, java.lang.String category, char mark)
data
- the data frame.x
- the column as x-axis.y
- the column as y-axis.category
- the category column for coloring.public static ScatterPlot of(smile.data.DataFrame data, java.lang.String x, java.lang.String y, java.lang.String z, char mark, java.awt.Color color)
data
- the data frame.x
- the column as x-axis.y
- the column as y-axis.z
- the column as z-axis.public static ScatterPlot of(smile.data.DataFrame data, java.lang.String x, java.lang.String y, java.lang.String z, java.lang.String category, char mark)
data
- the data frame.x
- the column as x-axis.y
- the column as y-axis.z
- the column as z-axis.