smile.plot
Class LinePlot
- java.lang.Object
-
- smile.plot.Shape
-
- smile.plot.Plot
-
- smile.plot.ScatterPlot
-
- smile.plot.LinePlot
-
public class LinePlot extends ScatterPlot
Line plot is a special scatter plot which connects points by straight lines.
-
-
Constructor Summary
Constructors Constructor and Description LinePlot(double[][] data)Constructor.LinePlot(double[][] data, Line.Style style)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.ColorgetColor()Returns the color of component.java.awt.StrokegetStroke()Returns the line stroke style.voidpaint(Graphics g)Draw the component with given graphics object.static PlotCanvasplot(double[] y)Create a plot canvas with the poly line plot of given data.static PlotCanvasplot(double[][] data, Line.Style style)Create a plot canvas with the poly line plot of given data.static PlotCanvasplot(double[][] data, Line.Style style, java.awt.Color color)Create a plot canvas with the poly line plot of given data.static PlotCanvasplot(double[] y, Line.Style style)Create a plot canvas with the poly line plot of given data.static PlotCanvasplot(double[] y, Line.Style style, java.awt.Color color)Create a plot canvas with the poly line plot of given data.static PlotCanvasplot(java.lang.String id, double[] y)Create a plot canvas with the poly line plot of given data.static PlotCanvasplot(java.lang.String id, double[][] data, Line.Style style)Create a plot canvas with the poly line plot of given data.static PlotCanvasplot(java.lang.String id, double[][] data, Line.Style style, java.awt.Color color)Create a plot canvas with the poly line plot of given data.static PlotCanvasplot(java.lang.String id, double[] y, Line.Style style)Create a plot canvas with the poly line plot of given data.static PlotCanvasplot(java.lang.String id, double[] y, Line.Style style, java.awt.Color color)Create a plot canvas with the poly line plot of given data.LinePlotsetColor(java.awt.Color color)Set the color of component.LinePlotsetLegend(char legend)Set the legend of points.LinePlotsetStroke(java.awt.Stroke stroke)Set the line stroke style.-
Methods inherited from class smile.plot.ScatterPlot
getLegend, plot, plot, plot, plot, plot, plot, plot, plot, plot, plot, plot, plot, plot, plot
-
Methods inherited from class smile.plot.Plot
getID, getToolBar, getToolTip, setID
-
-
-
-
Constructor Detail
-
LinePlot
public LinePlot(double[][] data)
Constructor.
-
LinePlot
public LinePlot(double[][] data, Line.Style style)Constructor.
-
-
Method Detail
-
setColor
public LinePlot setColor(java.awt.Color color)
Description copied from class:ShapeSet the color of component.
-
getColor
public java.awt.Color getColor()
Description copied from class:ShapeReturns the color of component.
-
getStroke
public java.awt.Stroke getStroke()
Returns the line stroke style.
-
setStroke
public LinePlot setStroke(java.awt.Stroke stroke)
Set the line stroke style.
-
setLegend
public LinePlot setLegend(char legend)
Description copied from class:ScatterPlotSet the legend of points.- Overrides:
setLegendin classScatterPlot
-
paint
public void paint(Graphics g)
Description copied from class:ShapeDraw the component with given graphics object.- Overrides:
paintin classScatterPlot
-
plot
public static PlotCanvas plot(double[] y)
Create a plot canvas with the poly line plot of given data.- Parameters:
y- a data vector that describes y coordinates of points. The x coordinates will be [0, n), where n is the length of y.
-
plot
public static PlotCanvas plot(java.lang.String id, double[] y)
Create a plot canvas with the poly line plot of given data.- Parameters:
id- the id of the plot.y- a data vector that describes y coordinates of points. The x coordinates will be [0, n), where n is the length of y.
-
plot
public static PlotCanvas plot(double[] y, Line.Style style)
Create a plot canvas with the poly line plot of given data.- Parameters:
y- a data vector that describes y coordinates of points. The x coordinates will be [0, n), where n is the length of y.style- the stroke style of line.
-
plot
public static PlotCanvas plot(java.lang.String id, double[] y, Line.Style style)
Create a plot canvas with the poly line plot of given data.- Parameters:
id- the id of the plot.y- a data vector that describes y coordinates of points. The x coordinates will be [0, n), where n is the length of y.style- the stroke style of line.
-
plot
public static PlotCanvas plot(double[] y, Line.Style style, java.awt.Color color)
Create a plot canvas with the poly line plot of given data.- Parameters:
y- a data vector that describes y coordinates of points. The x coordinates will be [0, n), where n is the length of y.style- the stroke style of line.color- the color of line.
-
plot
public static PlotCanvas plot(java.lang.String id, double[] y, Line.Style style, java.awt.Color color)
Create a plot canvas with the poly line plot of given data.- Parameters:
id- the id of the plot.y- a data vector that describes y coordinates of points. The x coordinates will be [0, n), where n is the length of y.style- the stroke style of line.color- the color of line.
-
plot
public static PlotCanvas plot(double[][] data, Line.Style style)
Create a plot canvas with the poly line plot of given data.- Parameters:
data- a n-by-2 or n-by-3 matrix that describes coordinates of points.style- the stroke style of line.
-
plot
public static PlotCanvas plot(java.lang.String id, double[][] data, Line.Style style)
Create a plot canvas with the poly line 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 points.style- the stroke style of line.
-
plot
public static PlotCanvas plot(double[][] data, Line.Style style, java.awt.Color color)
Create a plot canvas with the poly line plot of given data.- Parameters:
data- a n-by-2 or n-by-3 matrix that describes coordinates of points.style- the stroke style of line.color- the color of line.
-
plot
public static PlotCanvas plot(java.lang.String id, double[][] data, Line.Style style, java.awt.Color color)
Create a plot canvas with the poly line 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 points.style- the stroke style of line.color- the color of line.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG