Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.charts
Class EmpiricalChart

    java.lang.Object
      umontreal.iro.lecuyer.charts.XYChart
          umontreal.iro.lecuyer.charts.EmpiricalChart

    public class EmpiricalChart

extends XYChart

This class provides additional tools to create and manage empirical plots. Empirical plots are used to plot empirical distributions. The `EmpiricalChart` class is the simplest way to produce empirical plots only. Each `EmpiricalChart` object is linked with an `EmpiricalSeriesCollection` data set.

Constructor Summary
`EmpiricalChart()` Initializes a new `EmpiricalChart` instance with an empty data set.
`EmpiricalChart(String title, String XLabel, String YLabel, double[]... data)` Initializes a new `EmpiricalChart` instance with data `data`.
`EmpiricalChart(String title, String XLabel, String YLabel, double[] data, int numPoints)` Initializes a new `EmpiricalChart` instance with a set of points `data`.
`EmpiricalChart(String title, String XLabel, String YLabel, DoubleArrayList... data)` Similar to the above constructor, but with `DoubleArrayList`.
`EmpiricalChart(String title, String XLabel, String YLabel, TallyStore... tallies)` Initializes a new `EmpiricalChart` instance with data arrays contained in each `TallyStore` object.
`EmpiricalChart(String title, String XLabel, String YLabel, org.jfree.data.xy.XYSeriesCollection data)` Initializes a new `EmpiricalChart` instance with data `data`.

Method Summary
`EmpiricalSeriesCollection` | `getSeriesCollection()` Returns the chart's dataset.
`void` | `setSeriesCollection(EmpiricalSeriesCollection dataset)` Links a new dataset to the current chart.
`void` | `setTicksSynchro(int s)` Synchronizes x-axis ticks to the s-th series x-values.
`String` | `toLatex(double width, double height)` Exports the chart to a LATEX source code using PGF/TikZ.
`JFrame` | `view(int width, int height)` Displays chart on the screen using Swing.

Methods inherited from class umontreal.iro.lecuyer.charts.XYChart
`disableGrid, enableGrid, getChartMargin, getJFreeChart, getTitle, getXAxis, getYAxis, setAutoRange, setAutoRange, setChartMargin, setLatexDocFlag, setManualRange, setManualRange, setTitle`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### EmpiricalChart

    public EmpiricalChart()

  Initializes a new `EmpiricalChart` instance with an empty data set.

### EmpiricalChart

    public EmpiricalChart(String title,
                          String XLabel,
                          String YLabel,
                          double[]... data)

  Initializes a new `EmpiricalChart` 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 vectors `data` represents a collection of observation sets. Each vector of `data` represents a x-coordinates set. Therefore `data` [i], i = 0,…, n - 1, is used to draw the i-th plot. The values of each observation set `data`[i] must be sorted in increasing order.

  Parameters:
    `title` - chart title.
    `XLabel` - Label on x-axis.
    `YLabel` - Label on y-axis.
    `data` - series of point sets.

### EmpiricalChart

    public EmpiricalChart(String title,
                          String XLabel,
                          String YLabel,
                          double[] data,
                          int numPoints)

  Initializes a new `EmpiricalChart` instance with a set of points `data`. `title` is a title, `XLabel` is a short description of the x-axis and `YLabel` a short description of the y-axis. Vector `data` represents a x-coordinates set. The values of this observation set must be sorted in increasing order. Only the first `numPoints` of `data` will be considered to plot.

  Parameters:
    `title` - chart title.
    `XLabel` - Label on x-axis.
    `YLabel` - Label on y-axis.
    `data` - series of point sets.
    `numPoints` - number of points to plot

### EmpiricalChart

    public EmpiricalChart(String title,
                          String XLabel,
                          String YLabel,
                          DoubleArrayList... data)

  Similar to the above constructor, but with `DoubleArrayList`. A `DoubleArrayList` from the Colt library is used to store data. The values of each observation set `data`[i] must be sorted in increasing order.

  Parameters:
    `title` - chart title.
    `XLabel` - Label on x-axis.
    `YLabel` - Label on y-axis.
    `data` - series of point sets.

### EmpiricalChart

    public EmpiricalChart(String title,
                          String XLabel,
                          String YLabel,
                          TallyStore... tallies)

  Initializes a new `EmpiricalChart` instance with data arrays contained in each `TallyStore` object. The input parameter `tallies` represents a collection of observation sets. Therefore, the i-th `tallies` is used to draw the i-th plot.

  Parameters:
    `title` - chart title.
    `XLabel` - Label on x-axis.
    `YLabel` - Label on y-axis.
    `tallies` - series of observation sets.

### EmpiricalChart

    public EmpiricalChart(String title,
                          String XLabel,
                          String YLabel,
                          org.jfree.data.xy.XYSeriesCollection data)

  Initializes a new `EmpiricalChart` instance with data `data`. The input parameter `data` represents a set of plotting data. `XYSeriesCollection` is a `JFreeChart`-like container class used to store and manage observation sets.

  Parameters:
    `title` - chart title.
    `XLabel` - Label on x-axis.
    `YLabel` - Label on y-axis.
    `data` - series collection.

Method Detail

### getSeriesCollection

    public EmpiricalSeriesCollection getSeriesCollection()

  Returns the chart's dataset.

  Returns:
    the chart's dataset.

### setSeriesCollection

    public void setSeriesCollection(EmpiricalSeriesCollection dataset)

  Links a new dataset to the current chart.

  Parameters:
    `dataset` - new dataset.

### setTicksSynchro

    public void setTicksSynchro(int s)

  Synchronizes x-axis ticks to the s-th series x-values.

  Specified by:
    `setTicksSynchro` in class `XYChart`
  Parameters:
    `s` - series used to define ticks.

### view

    public JFrame 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.

  Specified by:
    `view` in class `XYChart`
  Parameters:
    `width` - frame width in pixels.
    `height` - frame height in pixels.
  Returns:
    frame containing the chart.

### toLatex

    public String 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.

  Specified by:
    `toLatex` in class `XYChart`
  Parameters:
    `width` - Chart's width in centimeters.
    `height` - Chart's height in centimeters.
  Returns:
    LaTeX source code.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.