public class LinePlot extends Plot
Constructor and Description |
---|
LinePlot(Line... lines)
Constructor.
|
LinePlot(Line[] lines,
Legend[] legends)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Canvas |
canvas()
Returns a canvas of the plot.
|
double[] |
getLowerBound()
Returns the lower bound of data.
|
double[] |
getUpperBound()
Returns the upper bound of data.
|
java.util.Optional<Legend[]> |
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 |
of(double[][] data,
java.awt.Color color)
Creates a line plot.
|
static LinePlot |
of(double[][] data,
Line.Style style)
Creates a line plot.
|
static LinePlot |
of(double[][] data,
Line.Style style,
java.awt.Color color)
Creates a line plot.
|
static LinePlot |
of(double[][] data,
Line.Style style,
java.awt.Color color,
java.lang.String label)
Creates a line plot.
|
static LinePlot |
of(double[] y,
java.awt.Color color)
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,
java.awt.Color color)
Creates a line plot with the index as the x coordinate.
|
static LinePlot |
of(double[] y,
Line.Style style,
java.awt.Color color,
java.lang.String label)
Creates a line plot with the index as the x coordinate.
|
void |
paint(Graphics g)
Draws the shape.
|
public LinePlot(Line... lines)
public java.util.Optional<Legend[]> legends()
Plot
public double[] getLowerBound()
Plot
getLowerBound
in class Plot
public double[] getUpperBound()
Plot
getUpperBound
in class Plot
public static LinePlot of(double[][] data)
public static LinePlot of(double[][] data, Line.Style style)
public static LinePlot of(double[][] data, java.awt.Color color)
public static LinePlot of(double[][] data, Line.Style style, java.awt.Color color)
public static LinePlot of(double[][] data, Line.Style style, java.awt.Color color, java.lang.String label)
public static LinePlot of(double[] y)
y
- the data vector of y coordinates.
The x coordinates will be [0, n), where n is the length of y.public static LinePlot of(double[] y, Line.Style style)
y
- the data vector of y coordinates.
The x coordinates will be [0, n), where n is the length of y.public static LinePlot of(double[] y, java.awt.Color color)
y
- the data vector of y coordinates.
The x coordinates will be [0, n), where n is the length of y.public static LinePlot of(double[] y, Line.Style style, java.awt.Color color)
y
- the data vector of y coordinates.
The x coordinates will be [0, n), where n is the length of y.public static LinePlot of(double[] y, Line.Style style, java.awt.Color color, java.lang.String label)
y
- the data vector of y coordinates.
The x coordinates will be [0, n), where n is the length of y.