smile.plot
Class ScatterPlot
- java.lang.Object
-
- smile.plot.Shape
-
- smile.plot.Plot
-
- smile.plot.ScatterPlot
-
-
Constructor Summary
Constructors Constructor and Description ScatterPlot(double[][] data)Constructor.ScatterPlot(double[][] data, char legend)Constructor.ScatterPlot(double[][] data, char legend, java.awt.Color color)Constructor.ScatterPlot(double[][] data, java.awt.Color color)Constructor.ScatterPlot(double[][] data, int[] y, char[] legends)Constructor.ScatterPlot(double[][] data, int[] y, char[] legends, java.awt.Color color)Constructor.ScatterPlot(double[][] data, int[] y, char[] legends, java.awt.Color[] palette)Constructor.ScatterPlot(double[][] data, int[] y, char legend, java.awt.Color[] palette)Constructor.ScatterPlot(double[][] data, int[] y, java.awt.Color[] palette)Constructor.ScatterPlot(double[][] data, java.lang.String[] labels)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description chargetLegend()Get the legend of points.voidpaint(Graphics g)Draw the component with given graphics object.static PlotCanvasplot(double[]... data)Create a plot canvas with the scatter plot of given data.static PlotCanvasplot(double[][] data, char legend)Create a plot canvas with the scatter plot of given data with specific legend.static PlotCanvasplot(double[][] data, char legend, java.awt.Color color)Create a plot canvas with the scatter plot of given data with specific legend and color.static PlotCanvasplot(double[][] data, java.awt.Color color)Create a plot canvas with the scatter plot of given data and specific color.static PlotCanvasplot(double[][] data, int[] y, char[] legend, java.awt.Color[] palette)Create a plot canvas with the scatter plot of given data with specific legend and color.static PlotCanvasplot(double[][] data, int[] y, char legend, java.awt.Color[] palette)Create a plot canvas with the scatter plot of given data with specific legend and color.static PlotCanvasplot(double[][] data, java.lang.String[] labels)Create a plot canvas with the scatter plot of given data.static PlotCanvasplot(java.lang.String id, double[]... data)Create a plot canvas with the scatter plot of given data.static PlotCanvasplot(java.lang.String id, double[][] data, char legend)Create a plot canvas with the scatter plot of given data with specific legend.static PlotCanvasplot(java.lang.String id, double[][] data, char legend, java.awt.Color color)Create a plot canvas with the scatter plot of given data with specific legend and color.static PlotCanvasplot(java.lang.String id, double[][] data, java.awt.Color color)Create a plot canvas with the scatter plot of given data and specific color.static PlotCanvasplot(java.lang.String id, double[][] data, int[] y, char[] legend, java.awt.Color[] palette)Create a plot canvas with the scatter plot of given data with specific legend and color.static PlotCanvasplot(java.lang.String id, double[][] data, int[] y, char legend, java.awt.Color[] palette)Create a plot canvas with the scatter plot of given data with specific legend and color.static PlotCanvasplot(java.lang.String id, double[][] data, java.lang.String[] labels)Create a plot canvas with the scatter plot of given data.ScatterPlotsetLegend(char legend)Set the legend of points.-
Methods inherited from class smile.plot.Plot
getID, getToolBar, getToolTip, setID
-
-
-
-
Constructor Detail
-
ScatterPlot
public ScatterPlot(double[][] data)
Constructor.
-
ScatterPlot
public ScatterPlot(double[][] data, java.lang.String[] labels)Constructor.
-
ScatterPlot
public ScatterPlot(double[][] data, char legend)Constructor.
-
ScatterPlot
public ScatterPlot(double[][] data, java.awt.Color color)Constructor.
-
ScatterPlot
public ScatterPlot(double[][] data, char legend, java.awt.Color color)Constructor.
-
ScatterPlot
public ScatterPlot(double[][] data, int[] y, char[] legends)Constructor.- Parameters:
data- The array of data to plot. The elements should be of dimension 2 or 3.y- The class label of each data point of size n, where n is the size of data.legends- The legend of each class, of size k, where k is the amount of unique values in y.
-
ScatterPlot
public ScatterPlot(double[][] data, int[] y, char[] legends, java.awt.Color color)Constructor.- Parameters:
data- The array of data to plot. The elements should be of dimension 2 or 3.y- The class label of each data point of size n, where n is the size of data.legends- The legend of each class, of size k, where k is the amount of unique values in y.color- The color of all data points.
-
ScatterPlot
public ScatterPlot(double[][] data, int[] y, java.awt.Color[] palette)Constructor.- Parameters:
data- The array of data to plot. The elements should be of dimension 2 or 3.y- The class label of each data point of size n, where n is the size of data.palette- The color of each class, of size k, where k is the amount of unique values in y.
-
ScatterPlot
public ScatterPlot(double[][] data, int[] y, char legend, java.awt.Color[] palette)Constructor.- Parameters:
data- The array of data to plot. The elements should be of dimension 2 or 3.y- The class label of each data point of size n, where n is the size of data.legend- The legend of all data points.palette- The color of each class, of size k, where k is the amount of unique values in y.
-
ScatterPlot
public ScatterPlot(double[][] data, int[] y, char[] legends, java.awt.Color[] palette)Constructor.- Parameters:
data- The array of data to plot. The elements should be of dimension 2 or 3.y- The class label of each data point of size n, where n is the size of data.legends- The legend of each class, of size k, where k is the amount of unique values in y.palette- The color of each class, of size k, where k is the amount of unique values in y.
-
-
Method Detail
-
paint
public void paint(Graphics g)
Description copied from class:ShapeDraw the component with given graphics object.
-
setLegend
public ScatterPlot setLegend(char legend)
Set the legend of points.
-
getLegend
public char getLegend()
Get the legend of points.
-
plot
public static PlotCanvas plot(double[]... data)
Create a plot canvas with the scatter plot of given data.- Parameters:
data- a n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
plot
public static PlotCanvas plot(java.lang.String id, double[]... data)
Create a plot canvas with the scatter plot of given data.- Parameters:
id- the id of the plot.data- a n-by-2 or n-by-3 matrix that describes coordinates of n points.
-
plot
public static PlotCanvas plot(double[][] data, java.lang.String[] labels)
Create a plot canvas with the scatter plot of given data.- Parameters:
data- a n-by-2 or n-by-3 matrix that describes coordinates of n points.labels- labels of points.
-
plot
public static PlotCanvas plot(java.lang.String id, double[][] data, java.lang.String[] labels)
Create a plot canvas with the scatter plot of given data.- Parameters:
id- the id of the plot.data- a n-by-2 or n-by-3 matrix that describes coordinates of n points.labels- labels of points.
-
plot
public static PlotCanvas plot(double[][] data, java.awt.Color color)
Create a plot canvas with the scatter plot of given data and specific color.- Parameters:
data- a n-by-2 or n-by-3 matrix that describes coordinates of points.color- the color used to draw points.
-
plot
public static PlotCanvas plot(java.lang.String id, double[][] data, java.awt.Color color)
Create a plot canvas with the scatter plot of given data and specific color.- Parameters:
id- the id of the plot.data- a n-by-2 or n-by-3 matrix that describes coordinates of points.color- the color used to draw points.
-
plot
public static PlotCanvas plot(double[][] data, char legend)
Create a plot canvas with the scatter plot of given data with specific legend.- Parameters:
data- a n-by-2 or n-by-3 matrix that describes coordinates of points.legend- the legend used to draw points.- . : dot
- + : +
- - : -
- | : |
- * : star
- x : x
- o : circle
- O : large circle
- @ : solid circle
- # : large solid circle
- s : square
- S : large square
- q : solid square
- Q : large solid square
- others : dot
-
plot
public static PlotCanvas plot(java.lang.String id, double[][] data, char legend)
Create a plot canvas with the scatter plot of given data with specific legend.- Parameters:
id- the id of the plot.data- a n-by-2 or n-by-3 matrix that describes coordinates of points.legend- the legend used to draw points.- . : dot
- + : +
- - : -
- | : |
- * : star
- x : x
- o : circle
- O : large circle
- @ : solid circle
- # : large solid circle
- s : square
- S : large square
- q : solid square
- Q : large solid square
- others : dot
-
plot
public static PlotCanvas plot(double[][] data, char legend, java.awt.Color color)
Create a plot canvas with the scatter plot of given data with specific legend and color.- Parameters:
data- a n-by-2 or n-by-3 matrix that describes coordinates of points.color- the color used to draw points.legend- the legend used to draw points.- . : dot
- + : +
- - : -
- | : |
- * : star
- x : x
- o : circle
- O : large circle
- @ : solid circle
- # : large solid circle
- s : square
- S : large square
- q : solid square
- Q : large solid square
- others : dot
-
plot
public static PlotCanvas plot(java.lang.String id, double[][] data, char legend, java.awt.Color color)
Create a plot canvas with the scatter plot of given data with specific legend and color.- Parameters:
id- the id of the plot.data- a n-by-2 or n-by-3 matrix that describes coordinates of points.color- the color used to draw points.legend- the legend used to draw points.- . : dot
- + : +
- - : -
- | : |
- * : star
- x : x
- o : circle
- O : large circle
- @ : solid circle
- # : large solid circle
- s : square
- S : large square
- q : solid square
- Q : large solid square
- others : dot
-
plot
public static PlotCanvas plot(double[][] data, int[] y, char legend, java.awt.Color[] palette)
Create a plot canvas with the scatter plot of given data with specific legend and color.- Parameters:
data- a n-by-2 or n-by-3 matrix that describes coordinates of points.y- the class labels of data.palette- the colors for each class.legend- the legend used to draw points.- . : dot
- + : +
- - : -
- | : |
- * : star
- x : x
- o : circle
- O : large circle
- @ : solid circle
- # : large solid circle
- s : square
- S : large square
- q : solid square
- Q : large solid square
- others : dot
-
plot
public static PlotCanvas plot(java.lang.String id, double[][] data, int[] y, char legend, java.awt.Color[] palette)
Create a plot canvas with the scatter plot of given data with specific legend and color.- Parameters:
id- the id of the plot.data- a n-by-2 or n-by-3 matrix that describes coordinates of points.y- the class labels of data.palette- the colors for each class.legend- the legend used to draw points.- . : dot
- + : +
- - : -
- | : |
- * : star
- x : x
- o : circle
- O : large circle
- @ : solid circle
- # : large solid circle
- s : square
- S : large square
- q : solid square
- Q : large solid square
- others : dot
-
plot
public static PlotCanvas plot(double[][] data, int[] y, char[] legend, java.awt.Color[] palette)
Create a plot canvas with the scatter plot of given data with specific legend and color.- Parameters:
data- a n-by-2 or n-by-3 matrix that describes coordinates of points.y- the class labels of data.palette- the colors for each class.legend- the legend used to draw points.- . : dot
- + : +
- - : -
- | : |
- * : star
- x : x
- o : circle
- O : large circle
- @ : solid circle
- # : large solid circle
- s : square
- S : large square
- q : solid square
- Q : large solid square
- others : dot
-
plot
public static PlotCanvas plot(java.lang.String id, double[][] data, int[] y, char[] legend, java.awt.Color[] palette)
Create a plot canvas with the scatter plot of given data with specific legend and color.- Parameters:
id- the id of the plot.data- a n-by-2 or n-by-3 matrix that describes coordinates of points.y- the class labels of data.palette- the colors for each class.legend- the legend used to draw points.- . : dot
- + : +
- - : -
- | : |
- * : star
- x : x
- o : circle
- O : large circle
- @ : solid circle
- # : large solid circle
- s : square
- S : large square
- q : solid square
- Q : large solid square
- others : dot
-
-
DataMelt 3.0 © DataMelt by jWork.ORG