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
Constructors -
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 BarPlotof(double[] data) Creates a bar plot.static BarPlotCreates a bar plot of multiple groups/colors.static BarPlotof(int[] data) Creates a bar plot.voidDraws the shape.
-
Constructor Details
-
BarPlot
Constructor. -
BarPlot
Constructor.
-
-
Method Details
-
paint
Description copied from class:ShapeDraws the shape. -
getLowerBound
public double[] getLowerBound()Description copied from class:PlotReturns the lower bound of data.- Specified by:
getLowerBoundin classPlot
-
getUpperBound
public double[] getUpperBound()Description copied from class:PlotReturns the upper bound of data.- Specified by:
getUpperBoundin classPlot
-
legends
Description copied from class:PlotReturns the optional name of shape, which will be used to draw a legend outside the box. -
canvas
Description copied from class:PlotReturns 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.
-