Provides tools to create and manage histograms. More...
Public Member Functions | |
| HistogramChart () | |
| Initializes a new HistogramChart instance with an empty data set. | |
| HistogramChart (String title, String XLabel, String YLabel, double[]... data) | |
| Initializes a new HistogramChart instance with input data. | |
| HistogramChart (String title, String XLabel, String YLabel, double[] data, int numPoints) | |
| Initializes a new HistogramChart instance with input data. | |
| HistogramChart (String title, String XLabel, String YLabel, DoubleArrayList... data) | |
| Initializes a new HistogramChart instance with data data. | |
| HistogramChart (String title, String XLabel, String YLabel, TallyStore... tallies) | |
| Initializes a new HistogramChart instance with data arrays contained in each umontreal.ssj.stat.TallyStore object. | |
| HistogramChart (String title, String XLabel, String YLabel, CustomHistogramDataset data) | |
| Initializes a new HistogramChart instance with data data. | |
| HistogramChart (String title, String XLabel, String YLabel, int[] count, double[] bound) | |
| Initializes a new HistogramChart instance with data count and bound. | |
| HistogramChart (String title, String XLabel, String YLabel, TallyHistogram... tallies) | |
| Initializes a new HistogramChart instance with data arrays contained in each umontreal.ssj.stat.TallyHistogram object. | |
| void | setAutoRange (boolean right, boolean top) |
| The \(x\) and the \(y\) ranges of the chart are set automatically. | |
| HistogramSeriesCollection | getSeriesCollection () |
| Returns the chart’s dataset. | |
| void | setSeriesCollection (HistogramSeriesCollection dataset) |
| Links a new dataset to the current chart. | |
| void | setTicksSynchro (int s) |
| Synchronizes \(x\)-axis ticks to the \(s\)-th histogram bins if the number of bins is not larger than 10; otherwise, choose approximately 10 ticks. | |
| JFrame | view (int width, int height) |
| Displays chart on the screen using Swing. | |
LaTeX-specific method @{ | |
| String | toLatex (double width, double height) |
| Exports the chart to a LaTeX source code using PGF/TikZ. | |
| Public Member Functions inherited from umontreal.ssj.charts.XYChart | |
| JFreeChart | getJFreeChart () |
| Returns the JFreeChart object associated with this chart. | |
| Axis | getXAxis () |
| Returns the chart’s domain axis ( \(x\)-axis) object. | |
| 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 | setprobFlag (boolean flag) |
| Must be set true when plotting probabilities, false otherwise. | |
| void | setAutoRange () |
| The \(x\) and the \(y\) ranges of the chart are set automatically. | |
| void | setAutoRange00 (boolean xZero, boolean yZero) |
| The \(x\) and the \(y\) ranges of the chart are set automatically. | |
| void | setManualRange (double[] range) |
| Sets the \(x\) and \(y\) ranges of the chart using the format: range =
[xmin, xmax, ymin, ymax]. | |
| void | setManualRange (double[] range, boolean right, boolean top) |
| Sets the \(x\) and \(y\) ranges of the chart using the format: range =
[xmin, xmax, ymin, ymax]. | |
| void | setManualRange00 (double[] range, boolean xZero, boolean yZero) |
| Sets the \(x\) and \(y\) ranges of the chart using the format: range =
[xmin, xmax, ymin, ymax]. | |
| double | getChartMargin () |
| Returns the chart margin, which is the fraction by which the chart is enlarged on its borders. | |
| void | setChartMargin (double margin) |
| Sets the chart margin to margin. | |
| void | drawVerticalLine (double x, String name, double yfrac, boolean right) |
| Draws a vertical line on the chart at \(x\)-coordinate x. | |
| void | enableGrid (double xstep, double ystep) |
| Puts a grid on the background. | |
| void | disableGrid () |
| Disables the background grid. | |
| void | toLatexFile (String fileName, double width, double height) |
| Transforms the chart to LaTeX form and writes it in file fileName. | |
| void | setLatexDocFlag (boolean flag) |
Flag to remove the \documentclass (and other) commands in the created LaTeX files. | |
Additional Inherited Members |
Provides tools to create and manage histograms.
Each HistogramChart object is linked with an HistogramSeriesCollection dataset.
Definition at line 49 of file HistogramChart.java.
| umontreal.ssj.charts.HistogramChart.HistogramChart | ( | ) |
Initializes a new HistogramChart instance with an empty data set.
Definition at line 71 of file HistogramChart.java.
| umontreal.ssj.charts.HistogramChart.HistogramChart | ( | String | title, |
| String | XLabel, | ||
| String | YLabel, | ||
| double...[] | data ) |
Initializes a new HistogramChart instance with input 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 collection of observation sets. Therefore data \([i], i = 0,…,n-1\), is used to plot the \(i\)th histogram.
| title | chart title. |
| XLabel | Label on \(x\)-axis. |
| YLabel | Label on \(y\)-axis. |
| data | series of point sets. |
Definition at line 90 of file HistogramChart.java.
| umontreal.ssj.charts.HistogramChart.HistogramChart | ( | String | title, |
| String | XLabel, | ||
| String | YLabel, | ||
| double[] | data, | ||
| int | numPoints ) |
Initializes a new HistogramChart instance with input 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 an observation set. Only the first numPoints of data will be considered to plot the histogram.
| title | chart title. |
| XLabel | Label on \(x\)-axis. |
| YLabel | Label on \(y\)-axis. |
| data | series of point sets. |
| numPoints | Number of points to plot |
Definition at line 110 of file HistogramChart.java.
| umontreal.ssj.charts.HistogramChart.HistogramChart | ( | String | title, |
| String | XLabel, | ||
| String | YLabel, | ||
| DoubleArrayList... | data ) |
Initializes a new HistogramChart instance with data data.
Each DoubleArrayList input parameter represents a collection of observation sets. DoubleArrayList is from the Colt library and is used to store data.
| title | chart title. |
| XLabel | Label on \(x\)-axis. |
| YLabel | Label on \(y\)-axis. |
| data | series of observation sets. |
Definition at line 128 of file HistogramChart.java.
| umontreal.ssj.charts.HistogramChart.HistogramChart | ( | String | title, |
| String | XLabel, | ||
| String | YLabel, | ||
| TallyStore... | tallies ) |
Initializes a new HistogramChart instance with data arrays contained in each umontreal.ssj.stat.TallyStore object.
The input parameter tallies represents a collection of observation sets.
| title | chart title. |
| XLabel | Label on \(x\)-axis. |
| YLabel | Label on \(y\)-axis. |
| tallies | series of observation sets. |
Definition at line 144 of file HistogramChart.java.
| umontreal.ssj.charts.HistogramChart.HistogramChart | ( | String | title, |
| String | XLabel, | ||
| String | YLabel, | ||
| CustomHistogramDataset | data ) |
Initializes a new HistogramChart instance with data data.
The input parameter data represents a set of plotting data.
umontreal.ssj.charts.CustomHistogramDataset is a JFreeChart-like container class that stores and manages observation sets.
| title | chart title. |
| XLabel | Label on \(x\)-axis. |
| YLabel | Label on \(y\)-axis. |
| data | series collection. |
Definition at line 162 of file HistogramChart.java.
| umontreal.ssj.charts.HistogramChart.HistogramChart | ( | String | title, |
| String | XLabel, | ||
| String | YLabel, | ||
| int[] | count, | ||
| double[] | bound ) |
Initializes a new HistogramChart instance with data count and bound.
The adjacent categories (or bins) are specified as non-overlapping intervals: bin[j] contains the values in the interval [bound[j], bound[j+1]], and count[j] is the number of such values. Thus the length of bound must be equal to the length of count plus one: the last value of bound is the right boundary of the last bin.
| title | chart title. |
| XLabel | Label on \(x\)-axis. |
| YLabel | Label on \(y\)-axis. |
| count | the number of observation between each bound. |
| bound | the bounds of the observations |
Definition at line 182 of file HistogramChart.java.
| umontreal.ssj.charts.HistogramChart.HistogramChart | ( | String | title, |
| String | XLabel, | ||
| String | YLabel, | ||
| TallyHistogram... | tallies ) |
Initializes a new HistogramChart instance with data arrays contained in each umontreal.ssj.stat.TallyHistogram object.
The input parameter tallies represents a collection of observation sets. The 2 extra bins at the beginning and at the end of the tallies are not counted nor represented in the chart.
| title | chart title. |
| XLabel | Label on \(x\)-axis. |
| YLabel | Label on \(y\)-axis. |
| tallies | series of observation sets. |
Definition at line 224 of file HistogramChart.java.
| HistogramSeriesCollection umontreal.ssj.charts.HistogramChart.getSeriesCollection | ( | ) |
Returns the chart’s dataset.
Definition at line 245 of file HistogramChart.java.
| void umontreal.ssj.charts.HistogramChart.setAutoRange | ( | boolean | right, |
| boolean | top ) |
The \(x\) and the \(y\) ranges of the chart are set automatically.
If right is true, the vertical axis will be on the left of the points, otherwise on the right. If top is true, the horizontal axis will be under the points, otherwise above the points.
| right | true if the x-values on the right of axis. |
| top | true if the y-values on the top of axis. |
Reimplemented from umontreal.ssj.charts.XYChart.
Definition at line 230 of file HistogramChart.java.
| void umontreal.ssj.charts.HistogramChart.setSeriesCollection | ( | HistogramSeriesCollection | dataset | ) |
Links a new dataset to the current chart.
| dataset | new dataset. |
Definition at line 254 of file HistogramChart.java.
| void umontreal.ssj.charts.HistogramChart.setTicksSynchro | ( | int | s | ) |
Synchronizes \(x\)-axis ticks to the \(s\)-th histogram bins if the number of bins is not larger than 10; otherwise, choose approximately 10 ticks.
| s | selects histogram used to define ticks. |
Reimplemented from umontreal.ssj.charts.XYChart.
Definition at line 265 of file HistogramChart.java.
| String umontreal.ssj.charts.HistogramChart.toLatex | ( | double | width, |
| double | height ) |
Exports the chart to a LaTeX source code using PGF/TikZ.
This method constructs and returns a string that can be written to a LaTeX document to render the plot. width and height represents the width and the height of the produced chart. These dimensions do not take into account the axes and labels extra space. The width and the height of the chart are measured in centimeters.
| width | Chart’s width in centimeters. |
| height | Chart’s height in centimeters. |
Reimplemented from umontreal.ssj.charts.XYChart.
Definition at line 328 of file HistogramChart.java.
| JFrame umontreal.ssj.charts.HistogramChart.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 width and the height of the chart are measured in pixels.
| width | frame width in pixels. |
| height | frame height in pixels. |
Reimplemented from umontreal.ssj.charts.XYChart.
Definition at line 309 of file HistogramChart.java.