Package smile.plot.swing
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
ConstructorDescriptionScatterPlot
(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 name of shape, which will be used to draw a legend outside the box.static ScatterPlot
of
(double[][] points) Create a scatter plot.static ScatterPlot
of
(double[][] points, char mark) Create a scatter plot.static ScatterPlot
Create a scatter plot.static ScatterPlot
of
(double[][] x, int[] y, char mark) Creates a scatter plot of multiple groups of data.static ScatterPlot
Create a scatter plot.static ScatterPlot
Creates a scatter plot of multiple groups of data.static ScatterPlot
Creates a scatter plot from a data frame.static ScatterPlot
Creates a scatter plot from a data frame.static ScatterPlot
Creates a scatter plot from a data frame.static ScatterPlot
Creates a scatter plot from a data frame.void
Draws the shape.
-
Constructor Details
-
ScatterPlot
Constructor. -
ScatterPlot
Constructor.
-
-
Method Details
-
paint
Description copied from class:Shape
Draws the shape. -
legends
Description copied from class:Plot
Returns the optional name of shape, which will be used to draw a legend outside the box. -
getLowerBound
public double[] getLowerBound()Description copied from class:Plot
Returns the lower bound of data.- Specified by:
getLowerBound
in classPlot
-
getUpperBound
public double[] getUpperBound()Description copied from class:Plot
Returns the upper bound of data.- Specified by:
getUpperBound
in classPlot
-
of
Create a scatter plot.- Parameters:
points
- an n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
of
Create a scatter plot.- Parameters:
points
- an n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
of
Create a scatter plot.- Parameters:
points
- an n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
of
Create a scatter plot.- Parameters:
points
- an n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-