uk.ac.starlink.ttools.plot2
Class TickCalc.BasicTickCalc
java.lang.Object
uk.ac.starlink.ttools.plot2.TickCalc
uk.ac.starlink.ttools.plot2.TickCalc.BasicTickCalc
- Enclosing class:
- TickCalc
public abstract static class TickCalc.BasicTickCalc
- extends TickCalc
Abstract TickCalc implementation that deals with fixed-length
tick labels.
Concrete subclasses must implement a method to create a Ticker
suitable for a given range, and this is used to provide suitable
ticks for particular circumstances, including avoiding label overlap.
Method Summary |
abstract Ticker |
createTicker(double dlo,
double dhi,
double approxMajorCount,
int adjust)
Returns a new ticker for labelling an axis in a given range. |
Tick[] |
getTicks(double dlo,
double dhi,
boolean withMinor,
Captioner captioner,
Orientation orient,
int npix,
double crowding)
Generates tick marks for labelling a plot axis. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TickCalc.BasicTickCalc
public TickCalc.BasicTickCalc(boolean logFlag)
- Constructor.
- Parameters:
logFlag
- true for logarithmic axis, false for linear
createTicker
public abstract Ticker createTicker(double dlo,
double dhi,
double approxMajorCount,
int adjust)
- Returns a new ticker for labelling an axis in a given range.
The tick density is determined by two parameters,
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.
- Parameters:
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 normal
getTicks
public Tick[] getTicks(double dlo,
double dhi,
boolean withMinor,
Captioner captioner,
Orientation orient,
int npix,
double crowding)
- Generates tick marks for labelling a plot axis.
This starts off by generating ticks at roughly a standard separation,
guided by the crowding parameter. However, if the resulting ticks
are so close as to overlap, it backs off until it finds a set of
ticks that can be displayed in a tidy fashion.
- Specified by:
getTicks
in class TickCalc
- Parameters:
dlo
- minimum axis data valuedhi
- maximum axis data valuewithMinor
- if true minor axes are included,
if false only major (labelled) ones arecaptioner
- caption painterorient
- label orientationnpix
- number of pixels along the axiscrowding
- 1 for normal tick density on the axis,
lower for fewer labels, higher for more
- Returns:
- tick array
Copyright © 2013 Central Laboratory of the Research Councils. All Rights Reserved.