Package smile.plot.swing
Class StaircasePlot
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.StaircasePlot
Staircase plot is a special case of line which is most useful to display
empirical distribution.
-
Constructor Summary
ConstructorsConstructorDescriptionStaircasePlot
(Staircase... lines) Constructor.StaircasePlot
(Staircase[] lines, Legend[] legends) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfigure()
Returns a figure containing the plot.double[]
Returns the lower bound of data.double[]
Returns the upper bound of data.legends()
Returns the optional legend of shape.static StaircasePlot
of
(double[][] data) Creates a line plot.static StaircasePlot
Creates a line plot.void
Draws the shape.
-
Constructor Details
-
StaircasePlot
Constructor.- Parameters:
lines
- the staircase lines.
-
StaircasePlot
Constructor.- Parameters:
lines
- the staircase lines.legends
- the line legends.
-
-
Method Details
-
legends
Description copied from class:Plot
Returns the optional legend of shape. -
figure
Description copied from class:Plot
Returns a figure containing the plot. -
getLowerBound
public double[] getLowerBound()Description copied from class:Plot
Returns the lower bound of data.- Specified by:
getLowerBound
in classPlot
- Returns:
- the lower bound of data.
-
getUpperBound
public double[] getUpperBound()Description copied from class:Plot
Returns the upper bound of data.- Specified by:
getUpperBound
in classPlot
- Returns:
- the upper bound of data.
-
paint
Description copied from class:Shape
Draws the shape. -
of
Creates a line plot.- Parameters:
data
- the point coordinates.- Returns:
- the plot.
-
of
Creates a line plot.- Parameters:
data
- the point coordinates.color
- the line color.label
- the legend label.- Returns:
- the plot.
-