public class BoxPlot extends Plot
Boxplots can be useful to display differences between populations without making any assumptions of the underlying statistical distribution: they are non-parametric. The spacings between the different parts of the box help indicate the degree of dispersion (spread) and skewness in the data, and identify outliers.
For a data set, we construct a boxplot in the following manner:
Constructor and Description |
---|
BoxPlot(double[][] data,
java.lang.String[] labels)
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.
|
static BoxPlot |
of(double[]... data)
Create a plot canvas with multiple box plots of given data.
|
void |
paint(Graphics g)
Draws the shape.
|
java.util.Optional<java.lang.String> |
tooltip(double[] coord)
Returns a optional tool tip for the object at given coordinates.
|
public BoxPlot(double[][] data, java.lang.String[] labels)
data
- the input dataset of which each row is a set of samples
and will have a corresponding box plot.public java.util.Optional<java.lang.String> tooltip(double[] coord)
Plot
public double[] getLowerBound()
Plot
getLowerBound
in class Plot
public double[] getUpperBound()
Plot
getUpperBound
in class Plot
public static BoxPlot of(double[]... data)
data
- a data matrix of which each row will create a box plot.