Package smile.plot.swing
Class LinePlot
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.LinePlot
Line plot is a special scatter plot which connects points by straight lines.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfigure()
Returns a figure containing the plot.double[]
Returns the lower bound of data.double[]
Returns the upper bound of data.legends()
Returns the optional legend of shape.static LinePlot
of
(double[] y) Creates a line plot with the index as the x coordinate.static LinePlot
of
(double[][] data) Creates a line plot.static LinePlot
Creates a line plot.static LinePlot
of
(double[][] data, Line.Style style) Creates a line plot.static LinePlot
of
(double[][] data, Line.Style style, Color color) Creates a line plot.static LinePlot
of
(double[][] data, Line.Style style, Color color, String label) Creates a line plot.static LinePlot
Creates a line plot with the index as the x coordinate.static LinePlot
of
(double[] y, Line.Style style) Creates a line plot with the index as the x coordinate.static LinePlot
of
(double[] y, Line.Style style, Color color) Creates a line plot with the index as the x coordinate.static LinePlot
of
(double[] y, Line.Style style, Color color, String label) Creates a line plot with the index as the x coordinate.void
Draws the shape.
-
Constructor Details
-
LinePlot
Constructor.- Parameters:
lines
- the lines.
-
LinePlot
Constructor.- Parameters:
lines
- the lines.legends
- the legends of lines.
-
-
Method Details
-
legends
Description copied from class:Plot
Returns the optional legend of shape. -
figure
Description copied from class:Plot
Returns a figure containing the plot. -
getLowerBound
public double[] getLowerBound()Description copied from class:Plot
Returns the lower bound of data.- Specified by:
getLowerBound
in classPlot
- Returns:
- the lower bound of data.
-
getUpperBound
public double[] getUpperBound()Description copied from class:Plot
Returns the upper bound of data.- Specified by:
getUpperBound
in classPlot
- Returns:
- the upper bound of data.
-
paint
Description copied from class:Shape
Draws the shape. -
of
Creates a line plot.- Parameters:
data
- the lines.- Returns:
- the line plot.
-
of
Creates a line plot.- Parameters:
data
- the lines.style
- the line style.- Returns:
- the line plot.
-
of
Creates a line plot.- Parameters:
data
- the lines.color
- the line color.- Returns:
- the line plot.
-
of
Creates a line plot.- Parameters:
data
- the lines.style
- the line style.color
- the line color.- Returns:
- the line plot.
-
of
Creates a line plot.- Parameters:
data
- the lines.style
- the line style.color
- the line color.label
- the line legend.- Returns:
- the line plot.
-
of
Creates a line plot with the index as the x coordinate.- Parameters:
y
- the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.- Returns:
- the line plot.
-
of
Creates a line plot with the index as the x coordinate.- Parameters:
y
- the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.style
- the line style.- Returns:
- the line plot.
-
of
Creates a line plot with the index as the x coordinate.- Parameters:
y
- the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.color
- the line color.- Returns:
- the line plot.
-
of
Creates a line plot with the index as the x coordinate.- Parameters:
y
- the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.style
- the line style.color
- the line color.- Returns:
- the line plot.
-
of
Creates a line plot with the index as the x coordinate.- Parameters:
y
- the data vector of y coordinates. The x coordinates will be [0, n), where n is the length of y.style
- the line style.color
- the line color.label
- the line legend.- Returns:
- the line plot.
-