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. TheEmpiricalChartclass is the simplest way to produce empirical plots only. EachEmpiricalChartobject is linked with anEmpiricalSeriesCollectiondata set.
-
-
Constructor Summary
Constructors Constructor and Description EmpiricalChart()Initializes a new EmpiricalChart instance with an empty data set.EmpiricalChart(java.lang.String title, java.lang.String XLabel, java.lang.String YLabel, double[]... data)Initializes a new EmpiricalChart instance with data data.EmpiricalChart(java.lang.String title, java.lang.String XLabel, java.lang.String YLabel, double[] data, int numPoints)Initializes a new EmpiricalChart instance with a set of points data.EmpiricalChart(java.lang.String title, java.lang.String XLabel, java.lang.String YLabel, DoubleArrayList... data)Similar to the above constructor, but with DoubleArrayList.EmpiricalChart(java.lang.String title, java.lang.String XLabel, java.lang.String YLabel, TallyStore... tallies)Initializes a new EmpiricalChart instance with data arrays contained in eachTallyStoreobject.EmpiricalChart(java.lang.String title, java.lang.String XLabel, java.lang.String YLabel, XYSeriesCollection data)Initializes a new EmpiricalChart instance with data data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description EmpiricalSeriesCollectiongetSeriesCollection()Returns the chart's dataset.voidsetSeriesCollection(EmpiricalSeriesCollection dataset)Links a new dataset to the current chart.voidsetTicksSynchro(int s)Synchronizes x-axis ticks to the s-th series x-values.java.lang.StringtoLatex(double width, double height)Exports the chart to a LATEX source code using PGF/TikZ.javax.swing.JFrameview(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, setAutoRange00, setChartMargin, setLatexDocFlag, setManualRange, setManualRange, setManualRange00, setprobFlag, setTitle, toLatexFile
-
-
-
-
Constructor Detail
-
EmpiricalChart
public EmpiricalChart()
Initializes a new EmpiricalChart instance with an empty data set.
-
EmpiricalChart
public EmpiricalChart(java.lang.String title, java.lang.String XLabel, java.lang.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(java.lang.String title, java.lang.String XLabel, java.lang.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(java.lang.String title, java.lang.String XLabel, java.lang.String YLabel, DoubleArrayList... data)Similar to the above constructor, but with DoubleArrayList. ADoubleArrayListfrom 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(java.lang.String title, java.lang.String XLabel, java.lang.String YLabel, TallyStore... tallies)Initializes a new EmpiricalChart instance with data arrays contained in eachTallyStoreobject. 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(java.lang.String title, java.lang.String XLabel, java.lang.String YLabel, 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:
setTicksSynchroin classXYChart- Parameters:
s- series used to define ticks.
-
view
public javax.swing.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.
-
toLatex
public java.lang.String toLatex(double width, double height)Description copied from class:XYChartExports 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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG