Package es.upm.etsisi.cf4j.util.plot
Class XYPlot
- java.lang.Object
-
- es.upm.etsisi.cf4j.util.plot.Plot
-
- es.upm.etsisi.cf4j.util.plot.XYPlot
-
public class XYPlot extends Plot
Implements an XYPlot.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XYPlot
addSeries(String seriesName)
Adds a new empty series to the plot.XYPlot
addSeries(String seriesName, double[] xs, double[] ys)
Adds a new series to the plot. xs and ys positions must be correlated with point labels.XYPlot
addSeries(String seriesName, double x, double y)
Adds a new series to the plot initializing x and y to a constant one for all point labels.protected String[][]
getDataContent(String xAxisTicksFormat, String yAxisTicksFormat)
Returns an String matrix with the content of the plot's data.protected String[]
getDataHeaders()
Returns an String array with the headers of the plot's dataprotected de.erichseifert.gral.plots.AbstractPlot
getGralPlot()
Gets an AbstractPlot using GRALXYPlot
setLabelsNotVisible(String seriesName)
Set the labels not visible for a seriesXYPlot
setLabelsVisible(String seriesName)
Set the labels visible for a seriesXYPlot
setXY(String seriesName, String label, double x, double y)
Sets a single point of a series-
Methods inherited from class es.upm.etsisi.cf4j.util.plot.Plot
draw, exportData, exportData, exportData, exportData, exportPlot, printData, printData, printData, toString, toString, toString
-
-
-
-
Method Detail
-
addSeries
public XYPlot addSeries(String seriesName)
Adds a new empty series to the plot. Points are initialized to x=0 and y=0 all point labels.- Parameters:
seriesName
- Series name- Returns:
- Self XYPlot instance
-
addSeries
public XYPlot addSeries(String seriesName, double x, double y)
Adds a new series to the plot initializing x and y to a constant one for all point labels.- Parameters:
seriesName
- Series namex
- x initializationy
- y initialization- Returns:
- Self XYPlot instance
-
addSeries
public XYPlot addSeries(String seriesName, double[] xs, double[] ys)
Adds a new series to the plot. xs and ys positions must be correlated with point labels.- Parameters:
seriesName
- Series namexs
- x valuesys
- y values- Returns:
- Self XYPlot instance
-
setXY
public XYPlot setXY(String seriesName, String label, double x, double y)
Sets a single point of a series- Parameters:
seriesName
- Series namelabel
- Label value of the point. Must existsx
- x valuey
- y value- Returns:
- Self XYPlot instance
-
setLabelsVisible
public XYPlot setLabelsVisible(String seriesName)
Set the labels visible for a series- Parameters:
seriesName
- Series name- Returns:
- Self XYPlot instance
-
setLabelsNotVisible
public XYPlot setLabelsNotVisible(String seriesName)
Set the labels not visible for a series- Parameters:
seriesName
- Series name- Returns:
- Self XYPlot instance
-
getDataHeaders
protected String[] getDataHeaders()
Description copied from class:Plot
Returns an String array with the headers of the plot's data- Specified by:
getDataHeaders
in classPlot
- Returns:
- Headers of the plot's data
-
getDataContent
protected String[][] getDataContent(String xAxisTicksFormat, String yAxisTicksFormat)
Description copied from class:Plot
Returns an String matrix with the content of the plot's data. First dimension denotes the row and second dimension denotes the column that must be correlated with the header returned by getDataHeaders().- Specified by:
getDataContent
in classPlot
- Parameters:
xAxisTicksFormat
- Number format for the values of the x axisyAxisTicksFormat
- Number format for the values of the x axis- Returns:
- String matrix with the content of the plot's data
-
getGralPlot
protected de.erichseifert.gral.plots.AbstractPlot getGralPlot()
Description copied from class:Plot
Gets an AbstractPlot using GRAL- Specified by:
getGralPlot
in classPlot
- Returns:
- GRAL's AbstractPlot
-
-