Package smile.plot.swing
Class Line
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Line
This class represents a poly line in the plot.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionLine
(double[][] points, Line.Style style, char mark, Color color) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic Line
of
(double[][] points) Creates a Line with solid stroke and black color.static Line
of
(double[][] points, char mark) Creates a Line.static Line
Creates a Line.static Line
of
(double[][] points, Line.Style style) Creates a Line.static Line
of
(double[][] points, Line.Style style, Color color) Creates a Line.void
Draws the shape.static double[][]
zipWithIndex
(double[] y) Returns a 2-dimensional array with the index as the x coordinate.
-
Constructor Details
-
Line
Constructor.- Parameters:
points
- an n-by-2 or n-by-3 matrix that are the coordinates of points.style
- the style of line.mark
- the mark of points.- white space : don't draw the 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
color
- the color of line.
-
-
Method Details
-
paint
Description copied from class:Shape
Draws the shape. -
zipWithIndex
public static double[][] zipWithIndex(double[] y) Returns a 2-dimensional array 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 with solid stroke and black color. -
of
Creates a Line. -
of
Creates a Line. -
of
Creates a Line. -
of
Creates a Line.
-