SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.charts.PlotFormat Class Reference

Provide tools to import and export data set tables to and from Gnuplot, MATLAB and Mathematica compatible formats, or customized format. More...

Static Public Member Functions

Data import functions @{
static double[][] fromGNUPlot (String data)
 Parses data according to the standard GNUPlot format and stores the extracted values in the returned table.
static double[][] fromCSV (String data)
 Parses data according to the standard CSV format and stores the extracted values in the returned table.
static double[][] fromCustomizedFormat (String betweenValues, String endLine, String data)
 Parses data according to a user defined format and stores the extracted values in the returned table.

Data export functions @{

static String toGNUPlot (double[]... data)
 Stores data tables data into a String, with format understandable by GNUPlot.
static String toGNUPlot (XYSeriesCollection data)
 Stores series collection data into a String, with format understandable by GNUPlot.
static String toCSV (double[]... data)
 Stores data tables data into a String with format CSV (comma-separated value tabular data).
static String toCSV (XYSeriesCollection data)
 Stores series collection data into a String with format CSV (comma-separated value tabular data).
static String toCustomizedFormat (String heading, String footer, String betweenValues, String endLine, int precision, double[]... data)
 Stores data tables data into a String with customized format.
static String toCustomizedFormat (String heading, String footer, String betweenValues, String endLine, int precision, XYSeriesCollection data)
 Stores data tables data into a String with customized format from an XYSeriesCollection variable.

Detailed Description

Provide tools to import and export data set tables to and from Gnuplot, MATLAB and Mathematica compatible formats, or customized format.

Definition at line 46 of file PlotFormat.java.

Member Function Documentation

◆ fromCSV()

double[][] umontreal.ssj.charts.PlotFormat.fromCSV ( String data)
static

Parses data according to the standard CSV format and stores the extracted values in the returned table.

Parameters
dataString to parse.
Returns
Table that represent data contained in data.
Exceptions
IllegalArgumentExceptionif each line of the input `String` doesn’t share the same number of values

Definition at line 139 of file PlotFormat.java.

◆ fromCustomizedFormat()

double[][] umontreal.ssj.charts.PlotFormat.fromCustomizedFormat ( String betweenValues,
String endLine,
String data )
static

Parses data according to a user defined format and stores the extracted values in the returned table.

betweenValues sets characters between values on the same line and endLine sets characters which separates each line of the input data set. Usually, this parameter contains the classic end of line character n. This method uses regular expressions, so it is possible to use regular characters as defined in the standard java API, specially in the class Pattern (package java.util.regex).

Parameters
betweenValuesString which separates values on the same line.
endLineString which separates lines.
dataString to parse.
Returns
Table that represent data contained in data.
Exceptions
IllegalArgumentExceptionif each line of the input `String` doesn’t share the same number of values

Definition at line 219 of file PlotFormat.java.

◆ fromGNUPlot()

double[][] umontreal.ssj.charts.PlotFormat.fromGNUPlot ( String data)
static

Parses data according to the standard GNUPlot format and stores the extracted values in the returned table.

All unrecognized characters and empty lines will be cut. Deleting comments inside the input String is recommended.

Parameters
dataString to parse.
Returns
Table that represent data contained in data.
Exceptions
IllegalArgumentExceptionif each line of the input `String` doesn’t share the same number of values

Definition at line 66 of file PlotFormat.java.

◆ toCSV() [1/2]

String umontreal.ssj.charts.PlotFormat.toCSV ( double...[] data)
static

Stores data tables data into a String with format CSV (comma-separated value tabular data).

The output string could be imported from a file to a matrix into Mathematica with Mathematica’s function Import["fileName", "CSV"], or into MATLAB with MATLAB’s function csvread(’fileName’).

Parameters
datadata tables.
Returns
String that represent data tables in CSV format.

Definition at line 331 of file PlotFormat.java.

◆ toCSV() [2/2]

String umontreal.ssj.charts.PlotFormat.toCSV ( XYSeriesCollection data)
static

Stores series collection data into a String with format CSV (comma-separated value tabular data).

Parameters
datadata tables.
Returns
String that represent data tables in CSV format.

Definition at line 353 of file PlotFormat.java.

◆ toCustomizedFormat() [1/2]

String umontreal.ssj.charts.PlotFormat.toCustomizedFormat ( String heading,
String footer,
String betweenValues,
String endLine,
int precision,
double...[] data )
static

Stores data tables data into a String with customized format.

heading sets the head of the returned String, footer sets its end, betweenValues sets characters between values on the same line and finally endLine sets characters which separates each line of the input data set. Normally, this parameter contains the classic end of line character ‘n’.

Parameters
headinghead of the returned String.
footerend of the returned String.
betweenValuesString which separates values on the same line.
endLineString which separates lines.
precisionnumber of decimal
datadata tables.
Returns
String that represent data tables in customized format.

Definition at line 372 of file PlotFormat.java.

◆ toCustomizedFormat() [2/2]

String umontreal.ssj.charts.PlotFormat.toCustomizedFormat ( String heading,
String footer,
String betweenValues,
String endLine,
int precision,
XYSeriesCollection data )
static

Stores data tables data into a String with customized format from an XYSeriesCollection variable.

Parameters
headinghead of the returned String.
footerend of the returned String.
betweenValuesString which separates values on the same line.
endLineString which separates lines.
precisionnumber of decimal
datadata tables.
Returns
String that represent data tables in customized format.

Definition at line 402 of file PlotFormat.java.

◆ toGNUPlot() [1/2]

String umontreal.ssj.charts.PlotFormat.toGNUPlot ( double...[] data)
static

Stores data tables data into a String, with format understandable by GNUPlot.

Parameters
datadata tables.
Returns
String that represent data tables in GNUPlot format.

Definition at line 297 of file PlotFormat.java.

◆ toGNUPlot() [2/2]

String umontreal.ssj.charts.PlotFormat.toGNUPlot ( XYSeriesCollection data)
static

Stores series collection data into a String, with format understandable by GNUPlot.

Parameters
datadata tables.
Returns
String that represent data tables in GNUPlot format.

Definition at line 318 of file PlotFormat.java.


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