public class Histogram extends BarPlot
Constructor and Description |
---|
Histogram(double[] data)
Constructor.
|
Histogram(double[] data,
boolean prob)
Constructor.
|
Histogram(double[] data,
double[] breaks)
Constructor.
|
Histogram(double[] data,
double[] breaks,
boolean prob)
Constructor.
|
Histogram(double[] data,
int k)
Constructor.
|
Histogram(double[] data,
int k,
boolean prob)
Constructor.
|
Histogram(int[] data)
Constructor.
|
Histogram(int[] data,
boolean prob)
Constructor.
|
Histogram(int[] data,
double[] breaks)
Constructor.
|
Histogram(int[] data,
double[] breaks,
boolean prob)
Constructor.
|
Histogram(int[] data,
int k)
Constructor.
|
Histogram(int[] data,
int k,
boolean prob)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double[][] |
getHistogram()
Returns the bin centers and frequencies/probabilities.
|
int |
getNumBins()
Returns the number of bins in the histogram.
|
java.lang.String |
getToolTip(double[] coord)
Returns a optional tool tip for the object at given coordinates.
|
static PlotCanvas |
plot(double[] data)
Create a plot canvas with the histogram plot.
|
static PlotCanvas |
plot(double[] data,
double[] breaks)
Create a plot canvas with the histogram plot of given data.
|
static PlotCanvas |
plot(double[] data,
int k)
Create a plot canvas with the histogram plot of given data.
|
static PlotCanvas |
plot(int[] data)
Create a plot canvas with the histogram plot.
|
static PlotCanvas |
plot(int[] data,
double[] breaks)
Create a plot canvas with the histogram plot of given data.
|
static PlotCanvas |
plot(int[] data,
int k)
Create a plot canvas with the histogram plot of given data.
|
static PlotCanvas |
plot(java.lang.String id,
double[] data)
Create a plot canvas with the histogram plot.
|
static PlotCanvas |
plot(java.lang.String id,
double[] data,
double[] breaks)
Create a plot canvas with the histogram plot of given data.
|
static PlotCanvas |
plot(java.lang.String id,
double[] data,
double[] breaks,
boolean prob)
Create a plot canvas with the histogram plot of given data.
|
static PlotCanvas |
plot(java.lang.String id,
double[] data,
int k)
Create a plot canvas with the histogram plot of given data.
|
static PlotCanvas |
plot(java.lang.String id,
int[] data)
Create a plot canvas with the histogram plot.
|
static PlotCanvas |
plot(java.lang.String id,
int[] data,
double[] breaks)
Create a plot canvas with the histogram plot of given data.
|
static PlotCanvas |
plot(java.lang.String id,
int[] data,
int k)
Create a plot canvas with the histogram plot of given data.
|
getID, getToolBar, setID
public Histogram(int[] data)
data
- a sample set.public Histogram(int[] data, boolean prob)
data
- a sample set.prob
- if true, the y-axis will be in the probability scale.
Otherwise, y-axis will be in the frequency scale.public Histogram(int[] data, int k)
data
- a sample set.k
- the number of bins.public Histogram(int[] data, int k, boolean prob)
data
- a sample set.k
- the number of bins.prob
- if true, the y-axis will be in the probability scale.
Otherwise, y-axis will be in the frequency scale.public Histogram(int[] data, double[] breaks)
data
- a sample set.breaks
- an array of size k+1 giving the breakpoints between
histogram cells. Must be in ascending order.public Histogram(int[] data, double[] breaks, boolean prob)
data
- a sample set.breaks
- an array of size k+1 giving the breakpoints between
histogram cells. Must be in ascending order.prob
- if true, the y-axis will be in the probability scale.
Otherwise, y-axis will be in the frequency scale.public Histogram(double[] data)
data
- a sample set.public Histogram(double[] data, boolean prob)
data
- a sample set.prob
- if true, the y-axis will be in the probability scale.
Otherwise, y-axis will be in the frequency scale.public Histogram(double[] data, int k)
data
- a sample set.k
- the number of bins.public Histogram(double[] data, int k, boolean prob)
data
- a sample set.k
- the number of bins.prob
- if true, the y-axis will be in the probability scale.
Otherwise, y-axis will be in the frequency scale.public Histogram(double[] data, double[] breaks)
data
- a sample set.breaks
- an array of size k+1 giving the breakpoints between
histogram cells. Must be in ascending order.public Histogram(double[] data, double[] breaks, boolean prob)
data
- a sample set.breaks
- an array of size k+1 giving the breakpoints between
histogram cells. Must be in ascending order.prob
- if true, the y-axis will be in the probability scale.
Otherwise, y-axis will be in the frequency scale.public double[][] getHistogram()
public int getNumBins()
public java.lang.String getToolTip(double[] coord)
Plot
getToolTip
in class BarPlot
coord
- the logical coordinates of current mouse position.public static PlotCanvas plot(double[] data)
data
- a sample set.public static PlotCanvas plot(java.lang.String id, double[] data)
id
- the id of the plot.data
- a sample set.public static PlotCanvas plot(double[] data, int k)
data
- a sample set.k
- the number of bins.public static PlotCanvas plot(java.lang.String id, double[] data, int k)
id
- the id of the plot.data
- a sample set.k
- the number of bins.public static PlotCanvas plot(double[] data, double[] breaks)
data
- a sample set.breaks
- an array of size k+1 giving the breakpoints between
histogram cells. Must be in ascending order.public static PlotCanvas plot(java.lang.String id, double[] data, double[] breaks)
id
- the id of the plot.data
- a sample set.breaks
- an array of size k+1 giving the breakpoints between
histogram cells. Must be in ascending order.public static PlotCanvas plot(java.lang.String id, double[] data, double[] breaks, boolean prob)
id
- the id of the plot.data
- a sample set.breaks
- an array of size k+1 giving the breakpoints between
histogram cells. Must be in ascending order.public static PlotCanvas plot(int[] data)
data
- a sample set.public static PlotCanvas plot(java.lang.String id, int[] data)
id
- the id of the plot.data
- a sample set.public static PlotCanvas plot(int[] data, int k)
data
- a sample set.k
- the number of bins.public static PlotCanvas plot(java.lang.String id, int[] data, int k)
id
- the id of the plot.data
- a sample set.k
- the number of bins.public static PlotCanvas plot(int[] data, double[] breaks)
data
- a sample set.breaks
- an array of size k+1 giving the breakpoints between
histogram cells. Must be in ascending order.public static PlotCanvas plot(java.lang.String id, int[] data, double[] breaks)
id
- the id of the plot.data
- a sample set.breaks
- an array of size k+1 giving the breakpoints between
histogram cells. Must be in ascending order.