Package cnuphys.splot.pdata
Class NiceScale
java.lang.Object
cnuphys.splot.pdata.NiceScale
-
Constructor Summary
ConstructorsConstructorDescriptionNiceScale
(double min, double max, int numTicks, boolean includeZero) Instantiates a new instance of the NiceScale class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the nice plot maxdouble
Get the nice plot minint
Get the number of ticks (including the ends)double
Get the tick spacingvoid
setMaxTicks
(int maxTicks) Sets maximum number of tick marks we're comfortable withvoid
setMinMaxPoints
(double min, double max) Sets the minimum and maximum data points for the axis.
-
Constructor Details
-
NiceScale
public NiceScale(double min, double max, int numTicks, boolean includeZero) Instantiates a new instance of the NiceScale class.- Parameters:
min
- the minimum data point on the axismax
- the maximum data point on the axisnumTicks
- the number of ticks including the ends
-
-
Method Details
-
getTickSpacing
public double getTickSpacing()Get the tick spacing- Returns:
- the tick spacing
-
getNiceMin
public double getNiceMin()Get the nice plot min- Returns:
- the nice plot min
-
getNiceMax
public double getNiceMax()Get the nice plot max- Returns:
- the nice plot max
-
setMinMaxPoints
public void setMinMaxPoints(double min, double max) Sets the minimum and maximum data points for the axis.- Parameters:
min
- the minimum data point on the axismax
- the maximum data point on the axis
-
setMaxTicks
public void setMaxTicks(int maxTicks) Sets maximum number of tick marks we're comfortable with- Parameters:
maxTicks
- the maximum number of tick marks for the axis
-
getNumTicks
public int getNumTicks()Get the number of ticks (including the ends)- Returns:
- the number of ticks
-