Package smile.plot.swing
Class BarPlot
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.BarPlot
A barplot draws bars with heights proportional to the value.
-
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 BarPlot
of
(double[] data) Creates a bar plot.static BarPlot
Creates a bar plot of multiple groups/colors.static BarPlot
of
(int[] data) Creates a bar plot.void
Draws the shape.
-
Constructor Details
-
BarPlot
Constructor. -
BarPlot
Constructor.
-
-
Method Details
-
paint
Description copied from class:Shape
Draws the shape. -
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
-
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. -
of
Creates a bar plot. -
of
Creates a bar plot. -
of
Creates a bar plot of multiple groups/colors.- Parameters:
data
- each row is a data set of bars (bar height).labels
- the group label of data points.
-