SSJ
3.3.1
Stochastic Simulation in Java
|
Stores data used in a HistogramChart
.
More...
Public Member Functions | |
HistogramSeriesCollection () | |
Creates a new HistogramSeriesCollection instance with empty dataset. | |
HistogramSeriesCollection (double[]... data) | |
Creates a new HistogramSeriesCollection instance with given data series. More... | |
HistogramSeriesCollection (double[] data, int numPoints) | |
Creates a new HistogramSeriesCollection instance with the given data series data . More... | |
HistogramSeriesCollection (DoubleArrayList... data) | |
Creates a new HistogramSeriesCollection . More... | |
HistogramSeriesCollection (TallyStore... tallies) | |
Creates a new HistogramSeriesCollection instance with default parameters and given data. More... | |
HistogramSeriesCollection (TallyHistogram... tallies) | |
Creates a new HistogramSeriesCollection instance with default parameters and given data. More... | |
HistogramSeriesCollection (CustomHistogramDataset data) | |
Creates a new HistogramSeriesCollection instance. More... | |
Data control methods | |
int | add (double[] data) |
Adds a data series into the series collection. More... | |
int | add (double[] data, int numPoints) |
Adds a data series into the series collection. More... | |
int | add (DoubleArrayList observationSet) |
Adds a data series into the series collection. More... | |
int | add (TallyStore tally) |
Adds a data series into the series collection. More... | |
CustomHistogramDataset | getSeriesCollection () |
Returns the CustomHistogramDataset object associated with the current variable. More... | |
List | getBins (int series) |
Returns the bins for a series. More... | |
void | setBins (int series, int bins) |
Sets bins periodic bins from the observation minimum values to the observation maximum value for a series. More... | |
void | setBins (int series, int bins, double minimum, double maximum) |
Sets bins periodic bins from minimum to maximum for a series. More... | |
void | setBins (int series, HistogramBin[] binsTable) |
Links bins given by table binsTable to a series. More... | |
List | getValuesList (int series) |
Returns the values for a series. More... | |
double [] | getValues (int series) |
Returns the values for a series. More... | |
void | setValues (int series, List valuesList) |
Sets a new values set to a series from a List variable. More... | |
void | setValues (int series, double[] values) |
Sets a new values set to a series from a table. More... | |
Rendering methods | |
boolean | getFilled (int series) |
Returns the filled flag associated with the series -th data series. More... | |
void | setFilled (int series, boolean filled) |
Sets the filled flag. More... | |
double | getMargin () |
Returns the margin which is a percentage amount by which the bars are trimmed. | |
void | setMargin (double margin) |
Sets the margin which is a percentage amount by which the bars are trimmed for all series. More... | |
double | getOutlineWidth (int series) |
Returns the outline width in pt. More... | |
void | setOutlineWidth (int series, double outline) |
Sets the outline width in pt. More... | |
String | toLatex (double XScale, double YScale, double XShift, double YShift, double xmin, double xmax, double ymin, double ymax) |
Public Member Functions inherited from SSJXYSeriesCollection | |
double | getX (int series, int index) |
Returns the \(x\)-value at the specified index in the specified series. More... | |
double | getY (int series, int index) |
Returns the \(y\)-value at the specified index in the specified series. More... | |
XYDataset | getSeriesCollection () |
Returns the XYDataset object associated with the current object. More... | |
double [] | getDomainBounds () |
Returns domain ( \(x\)-coordinates) min and max values. More... | |
double [] | getRangeBounds () |
Returns range ( \(y\)-coordinates) min and max values. More... | |
String | toString () |
Returns in a String all data contained in the current object. More... | |
XYItemRenderer | getRenderer () |
Returns the XYItemRenderer object associated with the current object. More... | |
void | setRenderer (XYItemRenderer renderer) |
Sets the XYItemRenderer object associated with the current variable. More... | |
Color | getColor (int series) |
Gets the current plotting color of the selected series. More... | |
void | setColor (int series, Color color) |
Sets a new plotting color to the series \(series\). More... | |
abstract String | toLatex (double XScale, double YScale, double XShift, double YShift, double xmin, double xmax, double ymin, double ymax) |
Formats and returns a string containing a LaTeX-compatible source code which represents this data series collection. More... | |
Protected Attributes | |
boolean [] | filled |
double [] | lineWidth |
int | numBin = 20 |
Protected Attributes inherited from SSJXYSeriesCollection | |
XYItemRenderer | renderer |
XYDataset | seriesCollection |
Additional Inherited Members | |
Static Protected Member Functions inherited from SSJXYSeriesCollection | |
static String | detectXColorClassic (Color color) |
Converts a java Color object into a friendly and readable LaTeX/xcolor string. More... | |
static Color | getDefaultColor (int index) |
Gives the default color associated with a series. More... | |
static double | max (double[] t) |
static double | min (double[] t) |
Stores data used in a HistogramChart
.
HistogramSeriesCollection
provides complementary tools to draw histograms. One may add observation sets, define histogram bins, set plot color and plot style, enable/disable filled shapes, and set margin between shapes for each series. This class is linked with class CustomHistogramDataset
to store data plots, and linked with JFreeChart XYBarRenderer
to render the plot. CustomHistogramDataset
has been developed at the Université de Montréal to extend the JFreeChart API, and is used to manage histogram datasets in a JFreeChart chart.
HistogramSeriesCollection | ( | double... [] | data | ) |
Creates a new HistogramSeriesCollection
instance with given data series.
Bins the elements of data in equally spaced containers (the number of bins can be changed using the method setBins ). Each input parameter represents a data series.
data | series of point sets. |
HistogramSeriesCollection | ( | double [] | data, |
int | numPoints | ||
) |
Creates a new HistogramSeriesCollection
instance with the given data series data
.
Bins the elements of data in equally spaced containers (the number of bins can be changed using the method setBins ). Only the first numPoints
of data
will be taken into account.
data | Point set |
numPoints | Number of points to plot |
HistogramSeriesCollection | ( | DoubleArrayList... | data | ) |
Creates a new HistogramSeriesCollection
.
Bins the elements of data in equally spaced containers (the number of bins can be changed using the method setBins ). The input parameter represents a set of data plots. Each DoubleArrayList variable corresponds to a histogram on the chart.
data | series of observation sets. |
HistogramSeriesCollection | ( | TallyStore... | tallies | ) |
Creates a new HistogramSeriesCollection
instance with default parameters and given data.
The input parameter represents a collection of data observation sets. Each TallyStore
input parameter represents an observation set.
tallies | series of point sets. |
HistogramSeriesCollection | ( | TallyHistogram... | tallies | ) |
Creates a new HistogramSeriesCollection
instance with default parameters and given data.
The input parameter represents a collection of data observation sets. Each TallyHistogram
input parameter represents an observation set. The 2 extra bins at the beginning and at the end of the tallies are not counted nor represented in the chart.
tallies | series of point sets. |
Creates a new HistogramSeriesCollection
instance.
The input parameter represents a set of plotting data. Each series of the given collection corresponds to a histogram.
data | series of point sets. |
int add | ( | double [] | data | ) |
Adds a data series into the series collection.
data | new series. |
int add | ( | double [] | data, |
int | numPoints | ||
) |
Adds a data series into the series collection.
Only the first numPoints
of data
will be added to the new series.
data | new series. |
numPoints | Number of points to add |
int add | ( | DoubleArrayList | observationSet | ) |
Adds a data series into the series collection.
observationSet | new series values. |
CustomHistogramDataset
object. int add | ( | TallyStore | tally | ) |
Adds a data series into the series collection.
tally | umontreal.ssj.stat.TallyStore to add values. |
CustomHistogramDataset
object. List getBins | ( | int | series | ) |
Returns the bins for a series.
series | the series index (in the range 0 to getSeriesCount() - 1 ). |
IndexOutOfBoundsException | if series is outside the specified range. |
boolean getFilled | ( | int | series | ) |
Returns the filled
flag associated with the series
-th data series.
series | series index. |
double getOutlineWidth | ( | int | series | ) |
Returns the outline width in pt.
series | series index. |
CustomHistogramDataset getSeriesCollection | ( | ) |
Returns the CustomHistogramDataset
object associated with the current variable.
CustomHistogramDataset
object associated with the current variable. double [] getValues | ( | int | series | ) |
Returns the values for a series.
series | the series index (in the range 0 to getSeriesCount() - 1 ). |
( | I ndexOutOfBoundsException if series is outside the specified range. |
List getValuesList | ( | int | series | ) |
Returns the values for a series.
series | the series index (in the range 0 to getSeriesCount() - 1 ). |
( | I ndexOutOfBoundsException if series is outside the specified range. |
void setBins | ( | int | series, |
int | bins | ||
) |
Sets bins
periodic bins from the observation minimum values to the observation maximum value for a series.
series | the series index (in the range 0 to getSeriesCount() - 1 ). |
bins | the number of periodic bins. |
IndexOutOfBoundsException | if series is outside the specified range. |
void setBins | ( | int | series, |
int | bins, | ||
double | minimum, | ||
double | maximum | ||
) |
Sets bins
periodic bins from minimum
to maximum
for a series.
Values falling on the boundary of adjacent bins will be assigned to the higher indexed bin.
series | the series index (in the range 0 to getSeriesCount() - 1 ). |
bins | the number of periodic bins. |
minimum | minimum value. |
maximum | maximum value. |
IndexOutOfBoundsException | if series is outside the specified range. |
void setBins | ( | int | series, |
HistogramBin [] | binsTable | ||
) |
Links bins given by table binsTable
to a series.
Values falling on the boundary of adjacent bins will be assigned to the higher indexed bin.
series | the series index (in the range 0 to getSeriesCount() - 1 ). |
binsTable | new bins table. |
IndexOutOfBoundsException | if series is outside the specified range. |
void setFilled | ( | int | series, |
boolean | filled | ||
) |
Sets the filled
flag.
This option fills histogram rectangular. The fill color is the current series color, alpha’s color parameter will be used to draw transparency.
series | series index. |
filled | fill flag. |
void setMargin | ( | double | margin | ) |
Sets the margin which is a percentage amount by which the bars are trimmed for all series.
margin | margin percentage amount. |
void setOutlineWidth | ( | int | series, |
double | outline | ||
) |
Sets the outline width in pt.
series | series index. |
outline | outline width. |
void setValues | ( | int | series, |
List | valuesList | ||
) |
Sets a new values set to a series from a List
variable.
series | the series index (in the range 0 to getSeriesCount() - 1 ). |
valuesList | new values list. |
void setValues | ( | int | series, |
double [] | values | ||
) |
Sets a new values set to a series from a table.
series | the series index (in the range 0 to getSeriesCount() - 1 ). |
values | new values table. |