public class Axis extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
double[] |
axisMargins |
Constructor and Description |
---|
Axis()
Creates a default axis with 1 bin, a minimum value of 0, and maximum
value of 1.0.
|
Axis(double[] limits)
Creates an axis using the desired limits for the bins
|
Axis(int bins,
double min,
double max)
Creates an axis using the provided number of bins, minimum value, and maximum value
|
Modifier and Type | Method and Description |
---|---|
double |
convertFromUnit(double xUnit)
Scales the range by a specified unit
|
int |
getBin(double xVal)
Finds the specified value and returns which bin it is in
in array indexing format (i.e.
|
double |
getBinCenter(int bin)
Calculates and returns the median value of the bin number entered in the parameter
in array indexing format (i.e.
|
double[] |
getBinCenters() |
double |
getBinWidth(int bin)
Calculates and returns the width of the bin specified in the parameter
in array indexing format (i.e.
|
double[] |
getLimits()
A getter for the array of bin limits
|
int |
getNBins()
A getter for the number of bins, returned in array indexing format
(i.e.
|
String |
getTitle() |
double |
max()
A getter for the maximum value of the axis
|
double |
min()
A getter for the minimum value of the axis
|
void |
set(double[] limits)
Sets the specified limits to the axis
|
void |
set(int bins,
double min,
double max)
Sets the number of bins, the min, and the max to the axis
as well as calculates the bin widths.
|
void |
setTitle(String title) |
public Axis()
public Axis(double[] limits)
limits
- an array of the upper and lower limits of each binpublic Axis(int bins, double min, double max)
bins
- the number of bins to have on the axismin
- the minimum value for the axismax
- the maximum value for the axispublic void setTitle(String title)
public String getTitle()
public final void set(double[] limits)
limits
- the desired limits for the bins on the axispublic final void set(int bins, double min, double max)
bins
- the desired number of binsmin
- the minimum valuemax
- the maximum valuepublic double[] getLimits()
public int getNBins()
public double max()
public double[] getBinCenters()
public double min()
public double getBinCenter(int bin)
bin
- which bin to get the median value of, entered in array indexing formatpublic double getBinWidth(int bin)
bin
- the bin to get the width ofpublic int getBin(double xVal)
xVal
- the data value to find on the axispublic double convertFromUnit(double xUnit)
xUnit
- the unit to multiply the range of values byJas4pp 1.5 © Java Analysis Studio for Particle Physics