public abstract class BasicTicker extends Object implements Ticker
| Modifier and Type | Class and Description |
|---|---|
static interface |
BasicTicker.Rule
Defines a specific rule for generating major and minor axis tick marks.
|
| Modifier and Type | Field and Description |
|---|---|
static BasicTicker |
LINEAR
Ticker for linear axes.
|
static BasicTicker |
LOG
Ticker for logarithmic axes.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BasicTicker(Scale scale)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Ticker |
createHybridTicker(Scale scale,
double linthresh)
Returns a ticker instance that is linear within a given distance
of the origin and logarithmic or negative logarithmic for larger
absolute values.
|
abstract BasicTicker.Rule |
createRule(double dlo,
double dhi,
double approxMajorCount,
int adjust)
Returns a new rule for labelling an axis in a given range.
|
static Tick[] |
getMajorTicks(BasicTicker.Rule rule,
double dlo,
double dhi)
Use a given rule to generate major ticks in a given range of
coordinates.
|
static Tick[] |
getMinorTicks(BasicTicker.Rule rule,
double dlo,
double dhi)
Use a given rule to generate minor ticks in a given range of
coordinates.
|
TickRun |
getTicks(double dlo,
double dhi,
boolean withMinor,
Captioner captioner,
Orientation[] orients,
int npix,
double crowding)
Generates tick marks for labelling a plot axis.
|
static Caption |
linearLabel(long mantissa,
int exp)
Generates a major tick mark label suitable for use with linear axes.
|
static boolean |
overlaps(Tick[] ticks,
Axis axis,
Captioner captioner,
Orientation orient)
Determines whether the labels for a set of tick marks
would overlap when painted on a given axis.
|
public static final BasicTicker LINEAR
public static final BasicTicker LOG
protected BasicTicker(Scale scale)
scale - axis scalingpublic abstract BasicTicker.Rule createRule(double dlo, double dhi, double approxMajorCount, int adjust)
approxMajorCount, which gives a baseline value for
the number of ticks required over the given range, and
adjust.
Increasing adjust will give more major ticks, and
decreasing it will give fewer ticks.
Each value of adjust should result in a different tick count.dlo - minimum axis data valuedhi - maximum axis data valueapproxMajorCount - guide value for number of major ticks
in rangeadjust - adjusts density of major ticks, zero is normalpublic TickRun getTicks(double dlo, double dhi, boolean withMinor, Captioner captioner, Orientation[] orients, int npix, double crowding)
TickerThe supplied list of orientations is attempted in order; if the required crowding can be satisfied by any of them, that orientation will be used. If it can't be supplied by any (because of unavoidable label overlap) a lower crowding value may be used.
getTicks in interface Tickerdlo - minimum axis data valuedhi - maximum axis data valuewithMinor - if true minor axes are included,
if false only major (labelled) ones arecaptioner - caption painterorients - array of label orientations in order of preference,
must contain at least one elementnpix - number of pixels along the axiscrowding - 1 for normal tick density on the axis,
lower for fewer labels, higher for morepublic static Ticker createHybridTicker(Scale scale, double linthresh)
scale - axis scalinglinthresh - distance from origin within which ticks are linearpublic static Tick[] getMajorTicks(BasicTicker.Rule rule, double dlo, double dhi)
rule - tick generation ruledlo - minimum axis data valuedhi - maximum axis data valuepublic static Tick[] getMinorTicks(BasicTicker.Rule rule, double dlo, double dhi)
rule - tick generation ruledlo - minimum axis data valuedhi - maximum axis data valuepublic static Caption linearLabel(long mantissa, int exp)
mantissa - multiplierexp - power of 10public static boolean overlaps(Tick[] ticks, Axis axis, Captioner captioner, Orientation orient)
ticks - major tick marksaxis - axis on which the ticks will be drawncaptioner - caption painterorient - label orientationCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.