Package es.upm.etsisi.cf4j.util.plot
Class HistogramPlot
- java.lang.Object
-
- es.upm.etsisi.cf4j.util.plot.Plot
-
- es.upm.etsisi.cf4j.util.plot.HistogramPlot
-
public class HistogramPlot extends Plot
Implements a histogram plot.
-
-
Constructor Summary
Constructors Constructor Description HistogramPlot(String xLabel, int numBins)
Creates a new HistogramPlot
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HistogramPlot
addValue(double value)
Adds new value to the histogramprotected 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 GRALvoid
printData()
Prints the plot data into the standard outputvoid
printData(String axisTicksFormat)
Prints the plot data into the standard outputString
toString()
String
toString(String axisTicksFormat)
Stringify the plot data-
Methods inherited from class es.upm.etsisi.cf4j.util.plot.Plot
draw, exportData, exportData, exportData, exportData, exportPlot, printData, toString
-
-
-
-
Constructor Detail
-
HistogramPlot
public HistogramPlot(String xLabel, int numBins)
Creates a new HistogramPlot- Parameters:
xLabel
- Label of the x axisnumBins
- Number of bins of the histogram
-
-
Method Detail
-
addValue
public HistogramPlot addValue(double value)
Adds new value to the histogram- Parameters:
value
- Value- Returns:
- Self HistogramPlot instance
-
printData
public void printData()
Description copied from class:Plot
Prints the plot data into the standard output
-
printData
public void printData(String axisTicksFormat)
Description copied from class:Plot
Prints the plot data into the standard output
-
toString
public String toString(String axisTicksFormat)
Description copied from class:Plot
Stringify the plot data
-
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
-
-