Class ScatterPlot
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.ScatterPlot
The data is displayed as a collection of points.
-
Constructor Summary
ConstructorsConstructorDescriptionScatterPlot(Point... points) Constructor.ScatterPlot(Point[] points, Legend[] legends) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns the lower bound of data.double[]Returns the upper bound of data.legends()Returns the optional legend of shape.static ScatterPlotof(double[][] points) Create a scatter plot.static ScatterPlotof(double[][] points, char mark) Create a scatter plot.static ScatterPlotCreate a scatter plot.static ScatterPlotof(double[][] x, int[] y, char mark) Creates a scatter plot of multiple groups of data.static ScatterPlotCreate a scatter plot.static ScatterPlotCreates a scatter plot of multiple groups of data.static ScatterPlotCreates a scatter plot from a data frame.static ScatterPlotCreates a scatter plot from a data frame.static ScatterPlotCreates a scatter plot from a data frame.static ScatterPlotCreates a scatter plot from a data frame.voidDraws the shape.
-
Constructor Details
-
ScatterPlot
Constructor.- Parameters:
points- an n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
ScatterPlot
-
-
Method Details
-
paint
-
legends
-
getLowerBound
public double[] getLowerBound()Description copied from class:PlotReturns the lower bound of data.- Specified by:
getLowerBoundin classPlot- Returns:
- the lower bound of data.
-
getUpperBound
public double[] getUpperBound()Description copied from class:PlotReturns the upper bound of data.- Specified by:
getUpperBoundin classPlot- Returns:
- the upper bound of data.
-
of
Create a scatter plot.- Parameters:
points- an n-by-2 or n-by-3 matrix that describes coordinates of n points.- Returns:
- the scatter plot.
-
of
Create a scatter plot.- Parameters:
points- an n-by-2 or n-by-3 matrix that describes coordinates of n points.color- the point color.- Returns:
- the scatter plot.
-
of
Create a scatter plot.- Parameters:
points- an n-by-2 or n-by-3 matrix that describes coordinates of n points.mark- the point mark.- Returns:
- the scatter plot.
-
of
Create a scatter plot.- Parameters:
points- an n-by-2 or n-by-3 matrix that describes coordinates of n points.mark- the point mark.color- the point color.- Returns:
- the scatter plot.
-
of
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.mark- the point mark.- Returns:
- the scatter plot.
-
of
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.mark- the point mark.- Returns:
- the scatter plot.
-
of
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.mark- the point mark.color- the point color.- Returns:
- the scatter plot.
-
of
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.mark- the point mark.- Returns:
- the scatter plot.
-
of
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.mark- the point mark.color- the point color.- Returns:
- the scatter plot.
-
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.category- the category column for coloring.mark- the point mark.- Returns:
- the scatter plot.
-