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
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 name of shape, which will be used to draw a legend outside the box.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. -
ScatterPlot
Constructor.
-
-
Method Details
-
paint
Description copied from class:ShapeDraws the shape. -
legends
Description copied from class:PlotReturns the optional name of shape, which will be used to draw a legend outside the box. -
getLowerBound
public double[] getLowerBound()Description copied from class:PlotReturns the lower bound of data.- Specified by:
getLowerBoundin classPlot
-
getUpperBound
public double[] getUpperBound()Description copied from class:PlotReturns the upper bound of data.- Specified by:
getUpperBoundin classPlot
-
of
Create a scatter plot.- Parameters:
points- a n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
of
Create a scatter plot.- Parameters:
points- a n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
of
Create a scatter plot.- Parameters:
points- a n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
of
Create a scatter plot.- Parameters:
points- a 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
public static ScatterPlot of(smile.data.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(smile.data.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(smile.data.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.
-