SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Static Public Member Functions | Package Attributes | List of all members
PgfDataTable Class Reference

Represents a data table which has a name, a number of observations (rows), a number of fields (columns), an array that contains the names (identifiers) of the fields, and a two-dimensional array that contains the data. More...

Public Member Functions

 PgfDataTable (String tableName, String tableLabel, String[] fields, double[][] data)
 Constructs a table with the given table name, array of field names, and data observations. More...
 
String formatTable ()
 Formats the full table as a String, with the field names in the first row, and the data points (observations) in the following rows. More...
 
String formatTableTwoFields (int j1, int j2)
 Similar to formatTable, but retains only two selected columns of the table (i.e., two selected fields), specified by j1 and j2. More...
 
String formatPgfCurveAddPlot (int j1, int j2, String plotoptions)
 Similar to formatTableTwoFields, but outputs complete LaTeX code in an appropriate format that adds a curve of the field j2 against field j1 with the pgfplot package. More...
 
String formatPgfCurveAddPlot (String xaxis, String yaxis, String plotoptions)
 In this version, the two fields are specified by their names in the table. More...
 
String drawPgfPlotSingleCurve (String title, String axistype, String xaxis, String yaxis, int logbasis, String axisoptions, String plotoptions)
 Returns a String that contains a complete tikzpicture for the pgfplot package, showing the field j2 against field j1. More...
 
String drawPgfPlotSingleCurve (String title, String axistype, int j1, int j2, int logbasis, String axisoptions, String plotoptions)
 Similar to the previous one.
 
String formatTableThreeFields (int j1, int j2, int j3)
 Similar to formatTableTwoFields(int, int), but for three fields. More...
 
String formatPgfCurveAddPlot (int j1, int j2, int j3, String plotoptions)
 Similar to formatPgf, but outputs complete LaTeX code in an appropriate format that adds a curve of the three fields j3, j2, and j1 with the pgfplot package. More...
 
String drawPgfPlotSingleCurve (String title, String axistype, int j1, int j2, int j3, int logbasis, String axisoptions, String plotoptions)
 Same as drawPgfPlotSingleCurve(String, String, int, int, int, String, String) but for three-dimensional plots. More...
 

Static Public Member Functions

static String drawPgfPlotManyCurves (String title, String axistype, int j1, int j2, ArrayList< PgfDataTable > listCurves, int logbasis, String axisoptions, String plotoptions)
 Returns a string that contains a complete tikzpicture for the pgfplot package, showing the field j2 against field j1, for all the curves that belong to listCurves. More...
 
static String pgfplotFileHeader ()
 
static String pgfplotEndDocument ()
 

Package Attributes

String tableName
 
String tableLabel
 
String [] fields
 
double [][] data
 
int numFields
 
int numObservations
 

Detailed Description

Represents a data table which has a name, a number of observations (rows), a number of fields (columns), an array that contains the names (identifiers) of the fields, and a two-dimensional array that contains the data.

Methods are available to format the table, or selected columns of the table, or to produce LaTeX code to draw a plot of one field against another field using the pgfplot LaTeX package. These types of tables can also be passed to other software to perform further operations.

Constructor & Destructor Documentation

◆ PgfDataTable()

PgfDataTable ( String  tableName,
String  tableLabel,
String []  fields,
double  data[][] 
)

Constructs a table with the given table name, array of field names, and data observations.

Parameters
tableNameName (descriptor) of the table.
tableLabelA label (very short name) for the table, to be used in plots to identify curves.
fieldsThe names of the fields (the variables).
dataThe data points; the entry data[s] contains observation s.

Member Function Documentation

◆ drawPgfPlotManyCurves()

static String drawPgfPlotManyCurves ( String  title,
String  axistype,
int  j1,
int  j2,
ArrayList< PgfDataTable listCurves,
int  logbasis,
String  axisoptions,
String  plotoptions 
)
static

Returns a string that contains a complete tikzpicture for the pgfplot package, showing the field j2 against field j1, for all the curves that belong to listCurves.

Parameters
titleis the title of the plot.
j1first selected field.
j2second selected field.
listCurvesthere will be one curve for each table in this list.
loglogsays if we want a log-log plot (true) or not (false).
plotoptionsis used to specify the options of addplot: addplot[plotoptions]
Returns
LaTeX code as a string.

◆ drawPgfPlotSingleCurve() [1/2]

String drawPgfPlotSingleCurve ( String  title,
String  axistype,
String  xaxis,
String  yaxis,
int  logbasis,
String  axisoptions,
String  plotoptions 
)

Returns a String that contains a complete tikzpicture for the pgfplot package, showing the field j2 against field j1.

Parameters
titleis the title of the plot.
j1first selected field.
j2second selected field.
loglogsays if we want a log-log plot (true) or not (false).
plotoptionsis used to specify the options of addplot: addplot[plotoptions]
Returns
LaTeX code as a string.

◆ drawPgfPlotSingleCurve() [2/2]

String drawPgfPlotSingleCurve ( String  title,
String  axistype,
int  j1,
int  j2,
int  j3,
int  logbasis,
String  axisoptions,
String  plotoptions 
)

Same as drawPgfPlotSingleCurve(String, String, int, int, int, String, String) but for three-dimensional plots.

Parameters
titleisthe title of the plot.
j1first selected field.
j2second selected field.
j3third selected field.
loglogsays if we want a log-log plot (true) or not (false).
plotoptionsis used to specify the options of addplot: addplot[plotoptions]
Returns
LaTeX code as a string.

◆ formatPgfCurveAddPlot() [1/3]

String formatPgfCurveAddPlot ( int  j1,
int  j2,
String  plotoptions 
)

Similar to formatTableTwoFields, but outputs complete LaTeX code in an appropriate format that adds a curve of the field j2 against field j1 with the pgfplot package.

Parameters
<tt>j1</tt>number of first selected field.
<tt>j2</tt>number of second selected field.
plotoptionsis used to specify the options of addplot in the pgfplot package: addplot[plotoptions]
Returns
LaTeX code as a String.

◆ formatPgfCurveAddPlot() [2/3]

String formatPgfCurveAddPlot ( String  xaxis,
String  yaxis,
String  plotoptions 
)

In this version, the two fields are specified by their names in the table.

Parameters
<tt>xaxis</tt>first selected field.
<tt>yaxis</tt>second selected field.
plotoptionsis used to specify the options of addplot in the pgfplot package: addplot[plotoptions]
Returns
LaTeX code as a String.

◆ formatPgfCurveAddPlot() [3/3]

String formatPgfCurveAddPlot ( int  j1,
int  j2,
int  j3,
String  plotoptions 
)

Similar to formatPgf, but outputs complete LaTeX code in an appropriate format that adds a curve of the three fields j3, j2, and j1 with the pgfplot package.

Parameters
j1first selected field.
j2second selected field.
j3third selected field.
plotoptionsis used to specify the options of addplot: addplot[plotoptions]
Returns
LaTeX code as a string.

◆ formatTable()

String formatTable ( )

Formats the full table as a String, with the field names in the first row, and the data points (observations) in the following rows.

This format can be used directly by the pgfplot package in Latex.

Returns
the table as a String.

◆ formatTableThreeFields()

String formatTableThreeFields ( int  j1,
int  j2,
int  j3 
)

Similar to formatTableTwoFields(int, int), but for three fields.

Parameters
j1first selected field.
j2second selected field.
j3third selected field.
Returns
the table as a string.

◆ formatTableTwoFields()

String formatTableTwoFields ( int  j1,
int  j2 
)

Similar to formatTable, but retains only two selected columns of the table (i.e., two selected fields), specified by j1 and j2.

Note that the fields are numbered from 0.

Parameters
<tt>j1</tt>first selected field.
<tt>j2</tt>second selected field.
Returns
the table as a String.

The documentation for this class was generated from the following file: