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
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionLine(double[][] points, Line.Style style, char mark, Color color) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic Lineof(double[][] points) Creates a Line with solid stroke and black color.static Lineof(double[][] points, char mark) Creates a Line.static LineCreates a Line.static Lineof(double[][] points, Line.Style style) Creates a Line.static Lineof(double[][] points, Line.Style style, Color color) Creates a Line.voidDraws 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- a 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:ShapeDraws 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.
-