Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

## Package umontreal.iro.lecuyer.charts

This package contains classes to produce charts used in the Java software developed in the simulation laboratory of the DIRO, at the Université de Montréal.

See:
Description

Class Summary
Axis | Represents an axis of a chart encapsulated by an instance of `XYChart`.
BoxChart | Extends `CategoryChart`.
BoxSeriesCollection | This class stores data used in a `CategoryChart`.
CategoryChart | This class provides tools to create charts from data in a simple way.
ContinuousDistChart | This class provides tools to plot the density and the cumulative probability of a continuous probability distribution.
CustomHistogramDataset | A dataset that can be used for creating histograms.
DiscreteDistIntChart | This class provides tools to plot the mass function and the cumulative probability of a discrete probability distribution over the integers.
EmpiricalChart | This class provides additional tools to create and manage empirical plots.
EmpiricalRenderer | A renderer that draws horizontal lines between points and/or draws shapes at each data point to provide an empirical style chart.
EmpiricalSeriesCollection | Stores data used in a `EmpiricalChart`.
HistogramChart | Extends `XYChart`.
HistogramSeriesCollection | Stores data used in a `HistogramChart`.
MultipleDatasetChart | Provides tools to plot many datasets on the same chart.
PlotFormat | Provide tools to import and export data set tables to and from GNUPlot, Matlab and Mathematica compatible formats, or customized format.
ScatterChart | Extends `XYChart`.
SSJCategorySeriesCollection | Stores data used in a `CategoryChart`.
SSJXYSeriesCollection | Stores data used in a `XYChart`.
XYChart | This class provides tools to create charts from data in a simple way.
XYLineChart | Extends `XYChart`.
XYListSeriesCollection | This class extends `SSJXYSeriesCollection`.
YListChart | This class extends the class `XYLineChart`.
YListSeriesCollection | This class extends `XYListSeriesCollection`.

## Package umontreal.iro.lecuyer.charts Description

This package contains classes to produce charts used in the Java software developed in the simulation laboratory of the DIRO, at the Université de Montréal. This package provides tools for easy construction, visualization, and customization of XY plots, histograms, and empirical styled charts from a Java program. It uses and extends the free and ``open source'' JFreeChart tool to manage the charts. JFreeChart is distributed under the terms of the GNU Lesser General Public License (LGPL), and can be found at `http://www.jfree.org/jfreechart/`.

This package also provides facilities to export charts to PGF/TikZ source code, which can be included into LATEX documents. TikZ is a free LATEX package to produce pictures such as plots, and can be downloaded from `http://sourceforge.net/projects/pgf`.

The user does not need to be familiar with the JFreeChart package or the TikZ syntax to use these tools, except if customization is required. For this, one may see the API specification of JFreeChart, and the reference manual of TikZ.

The two basic abstract classes of package `charts` are `XYChart` and `CategoryChart`. All other charts inherit from one of these two. Charts are managed by the mother class which contains the data tables in a `*SeriesCollection` object, and the information about x-axis and y-axis in `Axis` instances. All these objects encapsulate JFreeChart instances along with some additional TikZ-specific attributes. The method `view` displays charts on screen while the method `toLatex` formats and returns a `String` which contains the TikZ source code that can be written to a LATEX file.

Several chart styles are available and each one is represented by a subclass of `XYChart` or of `CategoryChart`. The `XYLineChart` uses `XYListSeriesCollection` to plot curves and lines, the `HistogramSeriesCollection` class is used by `HistogramChart` to plot histograms, and the `EmpiricalSeriesCollection` is used by `EmpiricalChart` to plot empirical style charts. It is possible to draw a scatter plot or a box plot using `ScatterChart` or `BoxChart` respectively. These concrete subclasses have similar APIs, but they are specialized for different kinds of charts.

These charts can be customized using `*SeriesCollection` subclasses and `Axis`. First, one can use methods in the `XYChart` class for setting the range values and a background grid. One can also use the method `getSeriesCollection()` for subclasses of charts to obtain the dataset of the chart, which is represented by a `*SeriesCollection` object. This dataset can be customized in the following ways by calling methods on the series collection: selecting color, changing plot style (straight lines, curves, marks only, ...), putting marks on points, setting a label and selecting the dash pattern (solid, dotted, dashed, ...). The available properties depend on the type of chart. Moreover, objects representing the axes can be retrieved with `getXAxis` for the x-axis, and `getYAxis` for the y-axis. By using methods in `Axis`, many customizations are possible: setting a label to the axis, setting ticks labels and values (auto ticks, periodical ticks or manually defined ticks) and changing the twin axis position on the current axis to select where axes must appear. These settings are independent for each axis.

Each chart object from SSJ encapsulates a JFreeChart object: a `XYChart` instance contains a `JFreeChart` instance from JFreeChart API, a `*SeriesCollection` contains a `XYDataset` and a `XYItemRenderer`, and finally an `Axis` contains a `NumberAxis`. So any parameter proposed by JFreeChart is reachable through getter methods. However, changing the JFreeChart parameters directly may have no impact on the produced TikZ source code.

The two special classes `ContinuousDistChart` and `DiscreteDistIntChart` can be used to plot probability densities, mass functions, and cumulative probabilities for continuous or discrete distributions, which are implemented in package `probdist` of SSJ.

The package `charts` provides additional tools for formatting plot data, and creating charts with multiple datasets. The `PlotFormat` class offers basic tools to import and export data from files to tables. Supported file formats are GNUPlot and standard CSV, which is widely used and accepted by most mathematical softwares like Matlab and Mathematica. Customizing file input and output format is also possible. Finally `MultipleDatasetChart` provides tools to plot with different styles on the same chart.

For a series of examples, see the pdf documentation.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

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