|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.charts.SSJXYSeriesCollection umontreal.iro.lecuyer.charts.XYListSeriesCollection
public class XYListSeriesCollection
This class extends
SSJXYSeriesCollection
.
It stores data used in a XYLineChart or in other related charts.
XYListSeriesCollection provides complementary tools to draw
simple curves; for example, one may
add or remove plots series and modify plot style.
This class is linked with the JFreeChart XYSeriesCollection class to
store data plots,
and linked with the JFreeChart XYLineAndShapeRenderer to render the plot.
Each series must contain enough points to plot a nice curve.
It is recommended to use about 30 points. However, some rapidly
varying functions may require many more points. This class can be used to draw scatter plots.
Constructor Summary | |
---|---|
XYListSeriesCollection()
Creates a new XYListSeriesCollection instance with an empty dataset. |
|
XYListSeriesCollection(double[][]... data)
Creates a new XYListSeriesCollection instance with default parameters and given data series. |
|
XYListSeriesCollection(double[][] data,
int numPoints)
Creates a new XYListSeriesCollection instance with default parameters and given points data. |
|
XYListSeriesCollection(cern.colt.list.DoubleArrayList... data)
Creates a new XYListSeriesCollection instance with default parameters and given data. |
|
XYListSeriesCollection(XYSeriesCollection data)
Creates a new XYListSeriesCollection instance with default parameters and given data series. |
Method Summary | |
---|---|
int |
add(double[][] data)
Adds a data series into the series collection. |
int |
add(double[][] data,
int numPoints)
Adds data series into the series collection. |
int |
add(double[] x,
double[] y)
Adds a data series into the series collection. |
int |
add(double[] x,
double[] y,
int numPoints)
Adds a data series into the series collection. |
int |
add(cern.colt.list.DoubleArrayList data)
Adds a data series into the series collection. |
void |
disableAutoCompletion()
Disables auto completion option. |
void |
enableAutoCompletion()
Enables the auto completion option. |
String |
getDashPattern(int series)
Returns the dash pattern associated with the seriesth data series. |
String |
getMarksType(int series)
Returns the mark type associated with the seriesth data series. |
String |
getName(int series)
Gets the current name of the selected series. |
String |
getPlotStyle(int series)
Gets the current plot style for the selected series. |
void |
setDashPattern(int series,
String dashPattern)
Selects dash pattern for a data series. |
void |
setMarksType(int series,
String marksType)
Adds marks on the points of a data series. |
void |
setName(int series,
String name)
Sets the name of the selected series. |
void |
setPlotStyle(int series,
String plotStyle)
Selects the plot style for a given series. |
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. |
Methods inherited from class umontreal.iro.lecuyer.charts.SSJXYSeriesCollection |
---|
getColor, getDomainBounds, getRangeBounds, getRenderer, getSeriesCollection, getX, getY, setColor, setRenderer, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XYListSeriesCollection()
public XYListSeriesCollection(double[][]... data)
For example, if one n-row matrix data1 is given as argument, then the first row data1[0] represents the x-coordinate vector, and every other row data1 [i], i = 1,…, n - 1, represents a y-coordinate set for the points. Therefore matrix data1[i][j], i = 0,…, n - 1, corresponds to n - 1 curves, all with the same x-coordinates.
However, one may want to plot several curves with different x-coordinates. In that case, one should give the curves as matrices with two rows. For examples, if the argument data is made of three 2-row matrices data1, data2 and data3, then they represents three different curves, data*[0] being the x-coordinates, and data*[1] the y-coordinates of the curves.
However, we may also consider the sets of points above not as part of curves, but rather as several list of points.
data
- series of point sets.public XYListSeriesCollection(double[][] data, int numPoints)
data
- series of point sets.numPoints
- Number of points to plotpublic XYListSeriesCollection(cern.colt.list.DoubleArrayList... data)
DoubleArrayList
variable corresponds to a curve on the chart.
data
- series of point sets.public XYListSeriesCollection(XYSeriesCollection data)
data
- series of point sets.Method Detail |
---|
public int add(double[] x, double[] y)
x
- xi coordinates.y
- yi coordinates.
public int add(double[] x, double[] y, int numPoints)
x
- xi coordinates.y
- yi coordinates.numPoints
- Number of points to add
public int add(double[][] data)
data
- input data.
public int add(double[][] data, int numPoints)
data
- input data.numPoints
- Number of points to add for each new series
public int add(cern.colt.list.DoubleArrayList data)
data
- data series.
public String getName(int series)
series
- series index.
public void setName(int series, String name)
series
- series index.name
- point set new name.public void enableAutoCompletion()
public void disableAutoCompletion()
public String getMarksType(int series)
series
- series index.
public void setMarksType(int series, String marksType)
series
- series index.marksType
- mark type.public String getDashPattern(int series)
series
- series index.
public void setDashPattern(int series, String dashPattern)
setMarksType
must be called to choose the marks
(which are blank by default).
series
- series index.dashPattern
- dash style.public String getPlotStyle(int series)
series
- series index.
public void setPlotStyle(int series, String plotStyle)
series
- series index.plotStyle
- plot style.public String toLatex(double XScale, double YScale, double XShift, double YShift, double xmin, double xmax, double ymin, double ymax)
SSJXYSeriesCollection
toLatex
in class SSJXYSeriesCollection
XScale
- Domain original data scale.YScale
- Range original data scale.XShift
- Domain original data shift value.YShift
- Range original data shift value.xmin
- Domain min bound.xmax
- Domain nax bound.ymin
- Range min bound.ymax
- Range nax bound.
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |