SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.charts.BoxChart Class Reference

Provides tools to create and manage box-and-whisker plots. More...

Inheritance diagram for umontreal.ssj.charts.BoxChart:
umontreal.ssj.charts.CategoryChart

Public Member Functions

 BoxChart ()
 Initializes a new BoxChart instance with an empty data set.
 BoxChart (String title, String XLabel, String YLabel, double[] data, int numPoints)
 Initializes a new BoxChart instance with data data.
 BoxChart (String title, String XLabel, String YLabel, double[]... data)
 Initializes a new BoxChart instance with data data.
int add (double[] data)
 Adds a data series into the series collection.
int add (double[] data, int numPoints)
 Adds a data series into the series collection.
BoxSeriesCollection getSeriesCollection ()
 Returns the chart’s dataset.
void setSeriesCollection (BoxSeriesCollection dataset)
 Links a new dataset to the current chart.
void setFillBox (boolean fill)
 Sets fill to true, if the boxes are to be filled.
JFrame view (int width, int height)
 Displays chart on the screen using Swing.
Latex-specific method @{
String toLatex (double width, double height)
 NOT IMPLEMENTED.
Public Member Functions inherited from umontreal.ssj.charts.CategoryChart
JFreeChart getJFreeChart ()
 Returns the JFreeChart object associated with this chart.
Axis getYAxis ()
 Returns the chart’s range axis ( \(y\)-axis) object.
String getTitle ()
 Gets the current chart title.
void setTitle (String title)
 Sets a title to this chart.
void setAutoRange ()
 Sets chart \(y\) range to automatic values.
void enableGrid (double xstep, double ystep)
 Puts a grid on the background.
void disableGrid ()
 Disables the background grid.
void setLatexDocFlag (boolean flag)
 Same as in XYChart.

Additional Inherited Members

Detailed Description

Provides tools to create and manage box-and-whisker plots.

Each BoxChart object is linked with a BoxSeriesCollection data set.

A boxplot is a convenient way of viewing sets of numerical data through their summaries: the smallest observation, first quartile ( \(Q_1 = x_{.25}\)), median ( \(Q_2 = x_{.5}\)), third quartile ( \(Q_3 = x_{.75}\)), and largest observation. Sometimes, the mean and the outliers are also plotted. In the charts created by this class, the box has its lower limit at \(Q_1\) and its upper limit at \(Q_3\). The median is indicated by the line inside the box, while the mean is at the center of the filled circle inside the box. Define the interquartile range as ( \(Q_3 - Q_1\)). Any data observation which is more than \(1.5(Q_3 - Q_1)\) lower than the first quartile or \(1.5(Q_3 - Q_1)\) higher than the third quartile is considered an outlier. The smallest and the largest values that are not outliers are connected to the box with a vertical line or "whisker" which is ended by a horizontal line. Outliers are indicated by hollow circles outside the whiskers. Triangles indicate the existence of very far outliers.

Definition at line 56 of file BoxChart.java.

Constructor & Destructor Documentation

◆ BoxChart() [1/3]

umontreal.ssj.charts.BoxChart.BoxChart ( )

Initializes a new BoxChart instance with an empty data set.

Definition at line 80 of file BoxChart.java.

◆ BoxChart() [2/3]

umontreal.ssj.charts.BoxChart.BoxChart ( String title,
String XLabel,
String YLabel,
double[] data,
int numPoints )

Initializes a new BoxChart instance with data data.

title is a title, XLabel is a short description of the \(x\)-axis, and YLabel a short description of the \(y\)-axis. The input parameter data represents a set of plotting data. Only the first numPoints of data will be considered for the plot.

Parameters
titlechart title.
XLabelLabel on \(x\)-axis.
YLabelLabel on \(y\)-axis.
datapoint sets.
numPointsNumber of points to plot

Definition at line 99 of file BoxChart.java.

◆ BoxChart() [3/3]

umontreal.ssj.charts.BoxChart.BoxChart ( String title,
String XLabel,
String YLabel,
double...[] data )

Initializes a new BoxChart instance with data data.

title sets a title, XLabel is a short description of the \(x\)-axis, and YLabel is a short description of the \(y\)-axis. The input parameter data represents a set of plotting data.

Parameters
titlechart title.
XLabelLabel on \(x\)-axis.
YLabelLabel on \(y\)-axis.
dataseries of point sets.

Definition at line 116 of file BoxChart.java.

Member Function Documentation

◆ add() [1/2]

int umontreal.ssj.charts.BoxChart.add ( double[] data)

Adds a data series into the series collection.

Vector data represents a set of plotting data.

Parameters
datapoint sets.
Returns
Integer that represent the new point set’s position in the JFreeChart BoxSeriesCollection object.

Definition at line 130 of file BoxChart.java.

◆ add() [2/2]

int umontreal.ssj.charts.BoxChart.add ( double[] data,
int numPoints )

Adds a data series into the series collection.

Vector data represents a set of plotting data. Only the first numPoints of data will be taken into account for the new series.

Parameters
datapoint set.
numPointsnumber of points to add.
Returns
Integer that represent the new point set’s position in the JFreeChart BoxSeriesCollection object.

Definition at line 144 of file BoxChart.java.

◆ getSeriesCollection()

BoxSeriesCollection umontreal.ssj.charts.BoxChart.getSeriesCollection ( )

Returns the chart’s dataset.

Returns
the chart’s dataset.

Definition at line 155 of file BoxChart.java.

◆ setFillBox()

void umontreal.ssj.charts.BoxChart.setFillBox ( boolean fill)

Sets fill to true, if the boxes are to be filled.

Parameters
filltrue if the boxes are filled

Definition at line 173 of file BoxChart.java.

◆ setSeriesCollection()

void umontreal.ssj.charts.BoxChart.setSeriesCollection ( BoxSeriesCollection dataset)

Links a new dataset to the current chart.

Parameters
datasetnew dataset.

Definition at line 164 of file BoxChart.java.

◆ toLatex()

String umontreal.ssj.charts.BoxChart.toLatex ( double width,
double height )

NOT IMPLEMENTED.

Parameters
widthChart’s width in centimeters.
heightChart’s height in centimeters.
Returns
LaTeX source code.

Reimplemented from umontreal.ssj.charts.CategoryChart.

Definition at line 220 of file BoxChart.java.

◆ view()

JFrame umontreal.ssj.charts.BoxChart.view ( int width,
int height )

Displays chart on the screen using Swing.

This method creates an application containing a chart panel displaying the chart. The created frame is positioned on-screen, and displayed before it is returned. The circle represents the mean, the dark line inside the box is the median, the box limits are the first and third quartiles, the lower whisker (the lower line outside the box) is the first decile, and the upper whisker is the ninth decile. The outliers, if any, are represented by empty circles, or arrows if outside the range bounds.

Parameters
widthframe width.
heightframe height.
Returns
frame containing the chart.
    ;

Reimplemented from umontreal.ssj.charts.CategoryChart.

Definition at line 193 of file BoxChart.java.


The documentation for this class was generated from the following file: