|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot.AxisLabels
public class AxisLabels
Contains labels for an axis. The instance methods of this class don't do anything clever, but factory methods are provided which can perform sensible axis labelling.
Constructor Summary | |
---|---|
AxisLabels(double[] ticks,
String[] labels)
Sets up a new AxisLabels. |
Method Summary | |
---|---|
int |
getCount()
Returns the number of ticks on the axis. |
String |
getLabel(int itick)
Returns the label for one of the tick marks. |
double |
getTick(int itick)
Returns the axis position of one of the tick marks. |
static AxisLabels |
labelLinearAxis(double lo,
double hi,
int approxTicks)
Sets up axis labels for a linearly scaled axis. |
static AxisLabels |
labelLogAxis(double lo,
double hi,
int approxTicks)
Sets up axis labels for a logarithmically scaled axis. |
static void |
main(String[] args)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AxisLabels(double[] ticks, String[] labels)
ticks
- numeric values of the tickslabels
- string values for each of the elements of
ticks
Method Detail |
---|
public int getCount()
public double getTick(int itick)
itick
- index of the tick
public String getLabel(int itick)
getTick(itick)
, but some attempt
may be made to make the representation compact and tidy.
itick
- index of the tick
public String toString()
toString
in class Object
public static AxisLabels labelLinearAxis(double lo, double hi, int approxTicks)
lo
- lower bound of the axishi
- upper bound of the axisapproxTicks
- the approximate number of ticks you'd like to seepublic static AxisLabels labelLogAxis(double lo, double hi, int approxTicks)
lo
- lower bound of axishi
- upper bound of axisapproxTicks
- the approximate number of ticks you'd like to seepublic static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |