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
-
Method Summary
Modifier and TypeMethodDescriptioncanvas()
Returns a canvas of the plot.double[]
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 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. -
LinePlot
Constructor.
-
-
Method Details
-
legends
Description copied from class:Plot
Returns the optional name of shape, which will be used to draw a legend outside the box. -
canvas
Description copied from class:Plot
Returns a canvas of the plot. -
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
-
paint
Description copied from class:Shape
Draws the shape. -
of
Creates a line plot. -
of
Creates a line plot. -
of
Creates a line plot. -
of
Creates a line plot. -
of
Creates a 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.
-
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.
-
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.
-
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.
-
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.
-