public class Plot extends FrameSet
The current Frame of a Plot describes a "physical" coordinate system, which is the coordinate system in which plotting operations are specified. The results of each plotting operation are automatically transformed into graphical coordinates so as to appear in the plotting area (subject to any clipping which may be in effect).
Because the Mapping between physical and graphical coordinates may often be non-linear, or even discontinuous, most plotting does not result in simple straight lines. The basic plotting element is therefore not a straight line, but a geodesic curve (see astCurve, astGenCurve and astPolyCurve). A Plot also provides facilities for drawing markers or symbols (astMark), text (astText) and grid lines (astGridLine). It is also possible to draw curvilinear axes with optional coordinate grids (astGrid). A range of Plot attributes is available to allow precise control over the appearance of graphical output produced by these functions.
You may select different physical coordinate systems in which to plot (including the native graphical coordinate system itself) by selecting different Frames as the current Frame of a Plot, using its Current attribute. You may also set up clipping (see astClip) to limit the extent of any plotting you perform, and this may be done in any of the coordinate systems associated with the Plot, not necessarily the one you are plotting in.
Like any FrameSet, a Plot may also be used as a Frame. In this case, it behaves like its current Frame, which describes the physical coordinate system.
When used as a Mapping, a Plot describes the inter-relation between graphical coordinates (its base Frame) and physical coordinates (its current Frame). It differs from a normal FrameSet, however, in that an attempt to transform points which lie in clipped areas of the Plot will result in bad coordinate values (AST__BAD).
- Axes: Axis lines drawn through tick marks using astGrid
- Axis1: Axis line drawn through tick marks on axis 1 using astGrid
- Axis2: Axis line drawn through tick marks on axis 2 using astGrid
- Border: The Plot border drawn using astBorder or astGrid
- Curves: Geodesic curves drawn using astCurve, astGenCurve or astPolyCurve
- Grid: Grid lines drawn using astGridLine or astGrid
- Grid1: Grid lines which cross axis 1, drawn using astGridLine or astGrid
- Grid2: Grid lines which cross axis 2, drawn using astGridLine or astGrid
- Markers: Graphical markers (symbols) drawn using astMark
- NumLab: Numerical axis labels drawn using astGrid
- NumLab1: Numerical labels for axis 1 drawn using astGrid
- NumLab2: Numerical labels for axis 2 drawn using astGrid
- Strings: Text strings drawn using astText
- TextLab: Descriptive axis labels drawn using astGrid
- TextLab1: Descriptive label for axis 1 drawn using astGrid
- TextLab2: Descriptive label for axis 2 drawn using astGrid
- Ticks: Tick marks (both major and minor) drawn using astGrid
- Ticks1: Tick marks (both major and minor) for axis 1 drawn using astGrid
- Ticks2: Tick marks (both major and minor) for axis 2 drawn using astGrid
- Title: The Plot title drawn using astGrid
This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licence for more details.
You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,Fifth Floor, Boston, MA 02110-1301, USA
Plot
will be an object owned by a JComponent
(i.e. some object in a subclass of JComponent). In this case, the Plot's
paint
method should be called in the JComponent's
paintComponent
method. A minimal Plot-containing
JComponent might look like this:
class PlotHolder extends JPanel { public Plot plot; protected void paintComponent( Graphics g ) { super.paintComponent( g ); plot.paint( g ); } }
Mapping.Interpolator, Mapping.Spreader
AST__BASE, AST__CURRENT, AST__NOFRAME
LINEAR_INTERPOLATOR, LINEAR_SPREADER, NEAREST_INTERPOLATOR, NEAREST_SPREADER
AST__BAD, AST__TUNULL, pointer
Constructor and Description |
---|
Plot(Frame frame,
Rectangle2D graphrect,
double[] basebox)
Creates a Plot which plots onto a given rectangle.
|
Plot(Frame frame,
Rectangle2D graphrect,
double[] basebox,
int lgap,
int rgap,
int bgap,
int tgap)
Creates a Plot which plots onto a given rectangle with
specified proportional spaces round the edge.
|
Modifier and Type | Method and Description |
---|---|
void |
border()
Draw a border around valid regions of a Plot.
|
Rectangle2D |
boundingBox()
Return a bounding box for previously drawn graphics.
|
void |
clear()
Clears the component.
|
void |
clip(int iframe,
double[] lbnd,
double[] ubnd)
Set up or remove clipping for a Plot.
|
AstObject |
copy()
Returns a fairly deep copy of this object.
|
void |
curve(double[] start,
double[] finish)
Draw a geodesic curve.
|
void |
genCurve(Mapping map)
Draw a generalized curve.
|
boolean |
getBorder()
Get
draw a border around valid regions of a Plot.
|
String |
getC(String attrib)
Get a character attribute value by name.
|
int |
getClip()
Get
clip lines and/or markers at the Plot boundary.
|
boolean |
getClipOp()
Get
combine Plot clipping limits using a boolean OR.
|
int |
getColour(String element)
Get
colour index for a Plot element by graphical element.
|
double |
getD(String attrib)
Get a double precision attribute value by name.
|
boolean |
getDrawAxes()
Get
draw axes for a Plot.
|
boolean |
getDrawAxes(int axis)
Get
draw axes for a Plot by axis.
|
boolean |
getDrawTitle()
Get
draw a title for a Plot.
|
String |
getEdge(int axis)
Get
which edges to label in a Plot by axis.
|
boolean |
getEscape()
Get
allow changes of character attributes within strings.
|
float |
getF(String attrib)
Get a floating point attribute value by name.
|
int |
getFont()
Get
character font for a Plot element.
|
int |
getFont(String element)
Get
character font for a Plot element by graphical element.
|
double |
getGap(int axis)
Get
interval between linearly spaced major axis values of a Plot by axis.
|
Grf |
getGrf()
Gets the Grf object which implements the graphics.
|
boolean |
getGrid()
Get
draw grid lines for a Plot.
|
int |
getI(String attrib)
Get a integer attribute value by name.
|
boolean |
getInvisible()
Get
draw graphics using invisible ink.
|
long |
getL(String attrib)
Get a long integer attribute value by name.
|
double |
getLabelAt(int axis)
Get
where to place numerical labels for a Plot by axis.
|
String |
getLabelling()
Get
label and tick placement option for a Plot.
|
boolean |
getLabelUnits(int axis)
Get
use axis unit descriptions in a Plot by axis.
|
boolean |
getLabelUp(int axis)
Get
draw numerical Plot labels upright by axis.
|
double |
getLogGap(int axis)
Get
interval between major axis values of a Plot by axis.
|
boolean |
getLogLabel(int axis)
Get
use exponential format for numerical axis labels by axis.
|
boolean |
getLogPlot(int axis)
Get
map the plot logarithmically onto the screen by axis.
|
boolean |
getLogTicks(int axis)
Get
space the major tick marks logarithmically by axis.
|
double |
getMajTickLen(int axis)
Get
length of major tick marks for a Plot by axis.
|
int |
getMinTick(int axis)
Get
density of minor tick marks for a Plot by axis.
|
double |
getMinTickLen(int axis)
Get
length of minor tick marks for a Plot by axis.
|
boolean |
getNumLab(int axis)
Get
draw numerical axis labels for a Plot by axis.
|
double |
getNumLabGap(int axis)
Get
spacing of numerical labels for a Plot by axis.
|
double |
getSize()
Get
character size for a Plot element.
|
double |
getSize(String element)
Get
character size for a Plot element by graphical element.
|
int |
getStyle(String element)
Get
line style for a Plot element by graphical element.
|
boolean |
getTextLab(int axis)
Get
draw descriptive axis labels for a Plot by axis.
|
double |
getTextLabGap(int axis)
Get
spacing of descriptive axis labels for a Plot by axis.
|
boolean |
getTickAll()
Get
draw tick marks on all edges of a Plot.
|
double |
getTitleGap()
Get
vertical spacing for a Plot title.
|
double |
getTol()
Get
plotting tolerance.
|
double |
getWidth(String element)
Get
line width for a Plot element by graphical element.
|
void |
grid()
Draw a set of labelled coordinate axes.
|
void |
gridLine(int axis,
double[] start,
double length)
Draw a grid line (or axis) for a Plot.
|
void |
mark(int nmark,
int ncoord,
double[][] in,
int type)
Draw a set of markers for a Plot.
|
void |
paint(Graphics g)
Paints the component.
|
void |
polyCurve(int npoint,
int ncoord,
double[][] in)
Draw a series of connected geodesic curves.
|
void |
set(String settings)
Set attribute values for an Object.
|
void |
setBorder(boolean border)
Set
draw a border around valid regions of a Plot.
|
void |
setC(String attrib,
String value)
Set a character attribute value by name.
|
void |
setClip(int clip)
Set
clip lines and/or markers at the Plot boundary.
|
void |
setClipOp(boolean clipOp)
Set
combine Plot clipping limits using a boolean OR.
|
void |
setColour(int colour)
Set
colour index for a Plot element.
|
void |
setColour(String element,
int colour)
Set
colour index for a Plot element by graphical element.
|
void |
setD(String attrib,
double value)
Set a double precision attribute value by name.
|
void |
setDrawAxes(boolean drawAxes)
Set
draw axes for a Plot.
|
void |
setDrawAxes(int axis,
boolean drawAxes)
Set
draw axes for a Plot by axis.
|
void |
setDrawTitle(boolean drawTitle)
Set
draw a title for a Plot.
|
void |
setEdge(int axis,
String edge)
Set
which edges to label in a Plot by axis.
|
void |
setEscape(boolean escape)
Set
allow changes of character attributes within strings.
|
void |
setF(String attrib,
float value)
Set a floating point attribute value by name.
|
void |
setFont(int font)
Set
character font for a Plot element.
|
void |
setFont(String element,
int font)
Set
character font for a Plot element by graphical element.
|
void |
setGap(double gap)
Set
interval between linearly spaced major axis values of a Plot.
|
void |
setGap(int axis,
double gap)
Set
interval between linearly spaced major axis values of a Plot by axis.
|
void |
setGrf(Grf grf)
Sets the Grf object which implements the graphics.
|
void |
setGrid(boolean grid)
Set
draw grid lines for a Plot.
|
void |
setI(String attrib,
int value)
Set a integer attribute value by name.
|
void |
setInvisible(boolean invisible)
Set
draw graphics using invisible ink.
|
void |
setL(String attrib,
long value)
Set a long integer attribute value by name.
|
void |
setLabelAt(int axis,
double labelAt)
Set
where to place numerical labels for a Plot by axis.
|
void |
setLabelling(String labelling)
Set
label and tick placement option for a Plot.
|
void |
setLabelUnits(boolean labelUnits)
Set
use axis unit descriptions in a Plot.
|
void |
setLabelUnits(int axis,
boolean labelUnits)
Set
use axis unit descriptions in a Plot by axis.
|
void |
setLabelUp(boolean labelUp)
Set
draw numerical Plot labels upright.
|
void |
setLabelUp(int axis,
boolean labelUp)
Set
draw numerical Plot labels upright by axis.
|
void |
setLogGap(double logGap)
Set
interval between major axis values of a Plot.
|
void |
setLogGap(int axis,
double logGap)
Set
interval between major axis values of a Plot by axis.
|
void |
setLogLabel(boolean logLabel)
Set
use exponential format for numerical axis labels.
|
void |
setLogLabel(int axis,
boolean logLabel)
Set
use exponential format for numerical axis labels by axis.
|
void |
setLogPlot(boolean logPlot)
Set
map the plot logarithmically onto the screen.
|
void |
setLogPlot(int axis,
boolean logPlot)
Set
map the plot logarithmically onto the screen by axis.
|
void |
setLogTicks(boolean logTicks)
Set
space the major tick marks logarithmically.
|
void |
setLogTicks(int axis,
boolean logTicks)
Set
space the major tick marks logarithmically by axis.
|
void |
setMajTickLen(double majTickLen)
Set
length of major tick marks for a Plot.
|
void |
setMajTickLen(int axis,
double majTickLen)
Set
length of major tick marks for a Plot by axis.
|
void |
setMinTick(int minTick)
Set
density of minor tick marks for a Plot.
|
void |
setMinTick(int axis,
int minTick)
Set
density of minor tick marks for a Plot by axis.
|
void |
setMinTickLen(double minTickLen)
Set
length of minor tick marks for a Plot.
|
void |
setMinTickLen(int axis,
double minTickLen)
Set
length of minor tick marks for a Plot by axis.
|
void |
setNumLab(boolean numLab)
Set
draw numerical axis labels for a Plot.
|
void |
setNumLab(int axis,
boolean numLab)
Set
draw numerical axis labels for a Plot by axis.
|
void |
setNumLabGap(double numLabGap)
Set
spacing of numerical labels for a Plot.
|
void |
setNumLabGap(int axis,
double numLabGap)
Set
spacing of numerical labels for a Plot by axis.
|
void |
setSize(double size)
Set
character size for a Plot element.
|
void |
setSize(String element,
double size)
Set
character size for a Plot element by graphical element.
|
void |
setStyle(int style)
Set
line style for a Plot element.
|
void |
setStyle(String element,
int style)
Set
line style for a Plot element by graphical element.
|
void |
setTextLab(boolean textLab)
Set
draw descriptive axis labels for a Plot.
|
void |
setTextLab(int axis,
boolean textLab)
Set
draw descriptive axis labels for a Plot by axis.
|
void |
setTextLabGap(double textLabGap)
Set
spacing of descriptive axis labels for a Plot.
|
void |
setTextLabGap(int axis,
double textLabGap)
Set
spacing of descriptive axis labels for a Plot by axis.
|
void |
setTickAll(boolean tickAll)
Set
draw tick marks on all edges of a Plot.
|
void |
setTitleGap(double titleGap)
Set
vertical spacing for a Plot title.
|
void |
setTol(double tol)
Set
plotting tolerance.
|
void |
setWidth(double width)
Set
line width for a Plot element.
|
void |
setWidth(String element,
double width)
Set
line width for a Plot element by graphical element.
|
boolean |
test(String attrib)
Test if an Object attribute value is set.
|
void |
text(String text,
double[] pos,
float[] up,
String just)
Draw a text string for a Plot.
|
addFrame, getBase, getCurrent, getFrame, getMapping, getNframe, remapFrame, removeFrame, setBase, setCurrent
angle, axAngle, axDistance, axOffset, convert, distance, findFrame, format, getActiveUnit, getAlignSystem, getBottom, getDigits, getDigits, getDirection, getDomain, getDut1, getEpoch, getFormat, getLabel, getMatchEnd, getMaxAxes, getMinAxes, getNaxes, getNormUnit, getObsLat, getObsLon, getPermute, getPreserveAxes, getSymbol, getSystem, getTitle, getTop, getUnit, intersect, norm, offset, offset2, permAxes, pickAxes, resolve, setActiveUnit, setAlignSystem, setBottom, setDigits, setDigits, setDirection, setDomain, setDut1, setEpoch, setEpoch, setFormat, setLabel, setMatchEnd, setMaxAxes, setMinAxes, setObsLat, setObsLon, setPermute, setPreserveAxes, setSymbol, setSystem, setTitle, setTop, setUnit, unformat
decompose, getInvert, getNin, getNout, getReport, getTranForward, getTranInverse, invert, linearApprox, mapBox, mapSplit, rate, rebin, rebinD, rebinF, rebinI, resample, resampleB, resampleD, resampleF, resampleI, resampleL, resampleS, setInvert, setReport, simplify, tran1, tran2, tranGrid, tranN, tranP
annul, clear, delete, equals, finalize, getAstConstantI, getB, getID, getIdent, getNobject, getObjSize, getRefCount, hashCode, isThreaded, reportVersions, sameObject, setB, setID, setIdent, show, tune
public Plot(Frame frame, Rectangle2D graphrect, double[] basebox)
frame
- Pointer to a Frame describing the physical coordinate system
in which to plot. A pointer to a FrameSet may also be given,
in which case its current Frame will be used to define the
physical coordinate system and its base Frame will be mapped
on to graphical coordinates (see below).
If a null Object pointer (AST__NULL) is given, a default 2-dimensional Frame will be used to describe the physical coordinate system. Labels, etc. may then be attached to this by setting the appropriate Frame attributes (e.g. Label(axis)) for the Plot.
graphrect
- the rectangle which will form the area
onto which plotting is done (note this excludes the
area used for graph annotation).basebox
-
an 4-element array giving the coordinates of two points in
the supplied Frame (or base Frame if a FrameSet was supplied)
which correspond to the bottom left and top right corners
of the Rectangle graphrect
.
The first pair of values should give the (x,y) coordinates of the
bottom left corner and the second pair the top right corner.
Note that the order in which these points are
given is important because it defines up, down, left and right
for subsequent graphical operations.
public Plot(Frame frame, Rectangle2D graphrect, double[] basebox, int lgap, int rgap, int bgap, int tgap)
frame
- Pointer to a Frame describing the physical coordinate system
in which to plot. A pointer to a FrameSet may also be given,
in which case its current Frame will be used to define the
physical coordinate system and its base Frame will be mapped
on to graphical coordinates (see below).
If a null Object pointer (AST__NULL) is given, a default 2-dimensional Frame will be used to describe the physical coordinate system. Labels, etc. may then be attached to this by setting the appropriate Frame attributes (e.g. Label(axis)) for the Plot.
graphrect
- the rectangle within which both the plot and
space for axis annotations etc will be drawnbasebox
-
an 4-element array giving the coordinates of two points in
the supplied Frame (or base Frame if a FrameSet was supplied)
which correspond to the bottom left and top right corners
of the Rectangle graphrect
.
The first pair of values should give the (x,y) coordinates of the
bottom left corner and the second pair the top right corner.
Note that the order in which these points are
given is important because it defines up, down, left and right
for subsequent graphical operations.
lgap
- gap in graphics coordinates (pixels) free for
annotation at the left of the Rectanglergap
- gap in graphics coordinates (pixels) free for
annotation at the right of the Rectanglebgap
- gap in graphics coordinates (pixels) free for
annotation at the bottom of the Rectangletgap
- gap in graphics coordinates (pixels) free for
annotation at the top of the RectangleAstException
- if any error occurs in the AST library, or if
the specified gaps don't leave enough room for
any plottingpublic void paint(Graphics g)
paint
method of this Plot's Grf
object to (re)paint all the
graphics caused by any methods called on this Plot since its
creation or the last call of clear
.
It should normally be invoked by the paintComponent
method of the JComponent
which holds this Plot.g
- the graphics context into which to paint the graphicspublic void clear()
clear
method of this Plot's Grf
to reset the list of
items painted by the paint
method. This method does
not actually erase any graphics from the screen, but will cause
an immediately following call of paint
to draw
nothing.public Grf getGrf()
DefaultGrf
,
but custom implementations
of the Grf interface may be written and substituted if required.public void setGrf(Grf grf)
DefaultGrf
,
but custom implementations
of the Grf interface may be written and substituted if required.grf
- the Grf object to use for plottingpublic AstObject copy()
public String getC(String attrib)
AstObject
public double getD(String attrib)
AstObject
public float getF(String attrib)
AstObject
public long getL(String attrib)
AstObject
public int getI(String attrib)
AstObject
public void setC(String attrib, String value)
AstObject
public void setD(String attrib, double value)
AstObject
public void setF(String attrib, float value)
AstObject
public void setL(String attrib, long value)
AstObject
public void setI(String attrib, int value)
AstObject
public boolean test(String attrib)
AstObject
public void set(String settings)
AstObject
"attribute_1 = value_1, attribute_2 = value_2, ... "
where "attribute_n" specifies an attribute name, and the value to the right of each "=" sign should be a suitable textual representation of the value to be assigned. This value will be interpreted according to the attribute's data type.
The string supplied may also contain "printf"-style format specifiers, identified by "%" signs in the usual way. If present, these will be substituted by values supplied as additional optional arguments (using the normal "printf" rules) before the string is used.
public void border()
If the entire plotting area contains valid, unclipped physical coordinates, then the boundary will just be a rectangular box around the edges of the plotting area.
If the Plot is a Plot3D, this method is applied individually to each of the three 2D Plots encapsulated within the Plot3D (each of these Plots corresponds to a single 2D plane in the 3D graphics system). In addition, if the entire plotting volume has valid coordinates in the 3D current Frame of the Plot3D, then additional lines are drawn along the edges of the 3D plotting volume so that the entire plotting volume is enclosed within a cuboid grid.
AstException
- if an error occurred in the AST librarypublic Rectangle2D boundingBox()
AstException
- if an error occurred in the AST librarypublic void clip(int iframe, double[] lbnd, double[] ubnd)
iframe
- The index of the Frame within the Plot to which the clipping
limits supplied in "lbnd" and "ubnd" (below) refer. Clipping
may be applied to any of the coordinate systems associated
with a Plot (as defined by the Frames it contains), so this
index may take any value from 1 to the number of Frames in
the Plot (Nframe attribute). In addition, the values
AST__BASE and AST__CURRENT may be used to specify the base
and current Frames respectively.
For example, a value of AST__CURRENT causes clipping to be performed in physical coordinates, while a value of AST__BASE would clip in graphical coordinates. Clipping may also be removed completely by giving a value of AST__NOFRAME. In this case any clipping bounds supplied (below) are ignored.
lbnd
- An array with one element for each axis of the clipping Frame
(identified by the index "iframe"). This should contain the
lower bound, on each axis, of the region which is to remain
visible (unclipped).ubnd
- An array with one element for each axis of the clipping Frame
(identified by the index "iframe"). This should contain the
upper bound, on each axis, of the region which is to remain
visible (unclipped).AstException
- if an error occurred in the AST librarypublic void curve(double[] start, double[] finish)
Note that the geodesic curve is transformed into graphical coordinate space for plotting, so that a straight line in physical coordinates may result in a curved line being drawn if the Mapping involved is non-linear. Any discontinuities in the Mapping between physical and graphical coordinates are catered for, as is any clipping established using astClip.
If you need to draw many geodesic curves end-to-end, then the astPolyCurve function is equivalent to repeatedly using astCurve, but will usually be more efficient.
If you need to draw curves which are not geodesics, see astGenCurve or astGridLine.
start
- An array, with one element for each axis of the Plot, giving
the physical coordinates of the first point on the geodesic
curve.finish
- An array, with one element for each axis of the Plot, giving
the physical coordinates of the second point on the geodesic
curve.AstException
- if an error occurred in the AST librarypublic void genCurve(Mapping map)
If you need to draw simple straight lines (geodesics), astCurve or astPolyCurve will usually be easier to use and faster.
map
- Pointer to a Mapping. This Mapping should have 1 input
coordinate representing offset along the required curve,
normalized so that the start of the curve is at offset 0.0,
and the end of the curve is at offset 1.0. Note, this offset
does not need to be linearly related to distance along the curve.
The number of output coordinates should equal the number of axes
in the current Frame of the Plot. The Mapping should map a
specified offset along the curve, into the corresponding
coordinates in the current Frame of the Plot. The inverse
transformation need not be defined.AstException
- if an error occurred in the AST librarypublic void grid()
AstException
- if an error occurred in the AST librarypublic void gridLine(int axis, double[] start, double length)
The curve is transformed into graphical coordinate space for plotting, so that a straight line in physical coordinates may result in a curved line being drawn if the Mapping involved is non-linear. Any discontinuities in the Mapping between physical and graphical coordinates are catered for, as is any clipping established using astClip.
axis
- The index of the Plot axis whose physical coordinate value is
to be varied along the length of the curve (all other
coordinates will remain fixed). This value should lie in the
range from 1 to the number of Plot axes (Naxes attribute).start
- An array, with one element for each axis of the Plot, giving
the physical coordinates of the start of the curve.length
- The length of curve to be drawn, given as an increment along
the selected physical axis. This may be positive or negative.AstException
- if an error occurred in the AST librarypublic void mark(int nmark, int ncoord, double[][] in, int type)
nmark
- The number of markers to draw. This may be zero, in which
case nothing will be drawn.ncoord
- The number of coordinates being supplied for each mark
(i.e. the number of axes in the current Frame of the Plot, as
given by its Naxes attribute).in
- The address of the first element of a 2-dimensional array of
shape "[ncoord][indim]" giving the
physical coordinates of the points where markers are to be
drawn. These should be stored such that the value of
coordinate number "coord" for input mark number "mark" is
found in element "in[coord][mark]".type
- a value specifying the type (e.g. shape) of the marker
to be drawn. The available types are defined by the
Grf object which implements the graphics (by default
this is DefaultGrf
,
which uses the types defined by
DefaultGrfMarker
).AstException
- if an error occurred in the AST librarypublic void polyCurve(int npoint, int ncoord, double[][] in)
As with astCurve, full account is taken of the Mapping between physical and graphical coordinate systems. This includes any discontinuities and clipping established using astClip.
npoint
- The number of points between which geodesic curves are to be drawn.ncoord
- The number of coordinates being supplied for each point (i.e.
the number of axes in the current Frame of the Plot, as given
by its Naxes attribute).in
- The address of the first element in a 2-dimensional array of shape
"[ncoord][indim]" giving the
physical coordinates of the points which are to be joined in
sequence by geodesic curves. These should be stored such that
the value of coordinate number "coord" for point number
"point" is found in element "in[coord][point]".AstException
- if an error occurred in the AST librarypublic void text(String text, double[] pos, float[] up, String just)
text
- Pointer to a null-terminated character string containing the
text to be drawn. Trailing white space is ignored.pos
- An array, with one element for each axis of the Plot, giving
the physical coordinates of the point where the reference
position of the text string is to be placed.up
- An array holding the components of a vector in the "up"
direction of the text (in graphical coordinates). For
example, to get horizontal text, the vector {0.0f,1.0f} should
be supplied. For a basic Plot, 2 values should be supplied. For
a Plot3D, 3 values should be supplied, and the actual up vector
used is the projection of the supplied up vector onto the text plane
specified by the current value of the Plot3D's Norm attribute.just
- Pointer to a null-terminated character string identifying the
reference point for the text being drawn. The first character in
this string identifies the reference position in the "up" direction
and may be "B" (baseline), "C" (centre), "T" (top) or "M" (bottom).
The second character identifies the side-to-side reference position
and may be "L" (left), "C" (centre) or "R" (right ). The string is
case-insensitive, and only the first two characters are significant.
For example, a value of "BL" means that the left end of the baseline of the original (un-rotated) text is to be drawn at the position given by "pos".
AstException
- if an error occurred in the AST librarypublic boolean getBorder()
If the Border value of a Plot is non-zero, then this border will be drawn as part of the grid. Otherwise, the border is not drawn (although axis labels and tick marks will still appear, unless other relevant Plot attributes indicate that they should not). The default behaviour is to draw the border if tick marks and numerical labels will be drawn around the edges of the plotting area (see the Labelling attribute), but to omit it otherwise.
public void setBorder(boolean border)
If the Border value of a Plot is non-zero, then this border will be drawn as part of the grid. Otherwise, the border is not drawn (although axis labels and tick marks will still appear, unless other relevant Plot attributes indicate that they should not). The default behaviour is to draw the border if tick marks and numerical labels will be drawn around the edges of the plotting area (see the Labelling attribute), but to omit it otherwise.
border
- the Border attribute of this objectpublic int getClip()
The astClip function can be used to establish generalised clipping within arbitrary regions of the Plot.
public void setClip(int clip)
The astClip function can be used to establish generalised clipping within arbitrary regions of the Plot.
clip
- the Clip attribute of this objectpublic boolean getClipOp()
If the ClipOp attribute of a Plot is zero (the default), graphical output is visible only if it satisfies the clipping limits on all the axes of the clipping Frame (a boolean AND). Otherwise, if ClipOp is non-zero, output is visible if it satisfies the clipping limits on one or more axes (a boolean OR).
An important use of this attribute is to allow areas of a Plot to be left clear (e.g. as a background for some text). To achieve this, the lower and upper clipping bounds supplied to astClip should be reversed, and the ClipOp attribute of the Plot should be set to a non-zero value.
public void setClipOp(boolean clipOp)
If the ClipOp attribute of a Plot is zero (the default), graphical output is visible only if it satisfies the clipping limits on all the axes of the clipping Frame (a boolean AND). Otherwise, if ClipOp is non-zero, output is visible if it satisfies the clipping limits on one or more axes (a boolean OR).
An important use of this attribute is to allow areas of a Plot to be left clear (e.g. as a background for some text). To achieve this, the lower and upper clipping bounds supplied to astClip should be reversed, and the ClipOp attribute of the Plot should be set to a non-zero value.
clipOp
- the ClipOp attribute of this objectpublic int getColour(String element)
The range of integer colour indices available and their appearance is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default colour index supplied by this graphics system (normally, this is likely to result in white plotting on a black background, or vice versa).
The available elements are:
The mapping of an integer value to a colour is done by the
Grf object which implements the graphics. By default this is
a DefaultGrf
object,
which interprets the value like the result of a Color.getRGB()
call on the Color
object which represents the colour
to use.
This means the top 8 bits of the integer represent alpha blending
(0xff
means opaque and 0x00
means transparent)
and the bottom 24 bits represent RGB intensity. For example
opaque (i.e. normal) light grey would be 0xffc0c0c0
and semi-transparent light grey would be 0x80c0c0c0
.
Note that this means using a simple 24-bit RGB representation
will give you a transparent colour, which is probably not what you
want. Assuming you want to be able to see the results you should
do setColour(java.awt.Color.LIGHT_GRAY.getRGB())
or setColour(0xffc0c0c0)
,
and not setColour(0xc0c0c0)
.
element
- name of the graphical element for which the attribute
is to be gotDefaultGrf.attr(int, double, int)
public void setColour(String element, int colour)
The range of integer colour indices available and their appearance is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default colour index supplied by this graphics system (normally, this is likely to result in white plotting on a black background, or vice versa).
The available elements are:
The mapping of an integer value to a colour is done by the
Grf object which implements the graphics. By default this is
a DefaultGrf
object,
which interprets the value like the result of a Color.getRGB()
call on the Color
object which represents the colour
to use.
This means the top 8 bits of the integer represent alpha blending
(0xff
means opaque and 0x00
means transparent)
and the bottom 24 bits represent RGB intensity. For example
opaque (i.e. normal) light grey would be 0xffc0c0c0
and semi-transparent light grey would be 0x80c0c0c0
.
Note that this means using a simple 24-bit RGB representation
will give you a transparent colour, which is probably not what you
want. Assuming you want to be able to see the results you should
do setColour(java.awt.Color.LIGHT_GRAY.getRGB())
or setColour(0xffc0c0c0)
,
and not setColour(0xc0c0c0)
.
element
- name of the graphical element for which the attribute
is to be setcolour
- the Colour attribute for the indicated element of this
objectDefaultGrf.attr(int, double, int)
public void setColour(int colour)
The range of integer colour indices available and their appearance is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default colour index supplied by this graphics system (normally, this is likely to result in white plotting on a black background, or vice versa).
The mapping of an integer value to a colour is done by the
Grf object which implements the graphics. By default this is
a DefaultGrf
object,
which interprets the value like the result of a Color.getRGB()
call on the Color
object which represents the colour
to use.
This means the top 8 bits of the integer represent alpha blending
(0xff
means opaque and 0x00
means transparent)
and the bottom 24 bits represent RGB intensity. For example
opaque (i.e. normal) light grey would be 0xffc0c0c0
and semi-transparent light grey would be 0x80c0c0c0
.
Note that this means using a simple 24-bit RGB representation
will give you a transparent colour, which is probably not what you
want. Assuming you want to be able to see the results you should
do setColour(java.awt.Color.LIGHT_GRAY.getRGB())
or setColour(0xffc0c0c0)
,
and not setColour(0xc0c0c0)
.
colour
- the Colour attribute of this objectDefaultGrf.attr(int, double, int)
public boolean getDrawAxes(int axis)
If drawn, these axis lines will pass through any tick marks associated with numerical labels drawn to mark values on the axes. The location of these tick marks and labels (and hence the axis lines) is determined by the Plot's LabelAt(axis) attribute.
If the DrawAxes value of a Plot is non-zero (the default), then axis lines will be drawn, otherwise they will be omitted.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setDrawAxes(int axis, boolean drawAxes)
If drawn, these axis lines will pass through any tick marks associated with numerical labels drawn to mark values on the axes. The location of these tick marks and labels (and hence the axis lines) is determined by the Plot's LabelAt(axis) attribute.
If the DrawAxes value of a Plot is non-zero (the default), then axis lines will be drawn, otherwise they will be omitted.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.drawAxes
- the DrawAxes attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public boolean getDrawAxes()
If drawn, these axis lines will pass through any tick marks associated with numerical labels drawn to mark values on the axes. The location of these tick marks and labels (and hence the axis lines) is determined by the Plot's LabelAt(axis) attribute.
If the DrawAxes value of a Plot is non-zero (the default), then axis lines will be drawn, otherwise they will be omitted.
public void setDrawAxes(boolean drawAxes)
If drawn, these axis lines will pass through any tick marks associated with numerical labels drawn to mark values on the axes. The location of these tick marks and labels (and hence the axis lines) is determined by the Plot's LabelAt(axis) attribute.
If the DrawAxes value of a Plot is non-zero (the default), then axis lines will be drawn, otherwise they will be omitted.
drawAxes
- the DrawAxes attribute of this objectpublic boolean getDrawTitle()
If the DrawTitle value of a Plot is non-zero (the default), then the title will be drawn, otherwise it will be omitted.
public void setDrawTitle(boolean drawTitle)
If the DrawTitle value of a Plot is non-zero (the default), then the title will be drawn, otherwise it will be omitted.
drawTitle
- the DrawTitle attribute of this objectpublic String getEdge(int axis)
The values "left", "top", "right" and "bottom" (or any abbreviation) can be supplied for this attribute. The default is usually "bottom" for the first axis and "left" for the second axis. However, if exterior labelling was requested (see the Labelling attribute) but cannot be produced using these default Edge values, then the default values will be swapped if this enables exterior labelling to be produced.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setEdge(int axis, String edge)
The values "left", "top", "right" and "bottom" (or any abbreviation) can be supplied for this attribute. The default is usually "bottom" for the first axis and "left" for the second axis. However, if exterior labelling was requested (see the Labelling attribute) but cannot be produced using these default Edge values, then the default values will be swapped if this enables exterior labelling to be produced.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.edge
- the Edge attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public boolean getEscape()
If the Escape value of a Plot is one (the default), then any escape sequences in text strings produce the effects described below when printed. Otherwise, they are printed literally.
See also the GrfEscape.setEscapes(boolean)
function.
%% - Print a literal "%" character.
%^...+ - Draw subsequent characters as super-scripts. The digits "..." give the distance from the base-line of "normal" text to the base-line of the super-script text, scaled so that a value of "100" corresponds to the height of "normal" text. %^+ - Draw subsequent characters with the normal base-line.
%v...+ - Draw subsequent characters as sub-scripts. The digits "..." give the distance from the base-line of "normal" text to the base-line of the sub-script text, scaled so that a value of "100" corresponds to the height of "normal" text.
%v+ - Draw subsequent characters with the normal base-line (equivalent to %^+).
%>...+ - Leave a gap before drawing subsequent characters. The digits "..." give the size of the gap, scaled so that a value of "100" corresponds to the height of "normal" text.
%<...+ - Move backwards before drawing subsequent characters. The digits "..." give the size of the movement, scaled so that a value of "100" corresponds to the height of "normal" text.
%s...+ - Change the Size attribute for subsequent characters. The digits "..." give the new Size as a fraction of the "normal" Size, scaled so that a value of "100" corresponds to 1.0;
%s+ - Reset the Size attribute to its "normal" value.
%w...+ - Change the Width attribute for subsequent characters. The digits "..." give the new width as a fraction of the "normal" Width, scaled so that a value of "100" corresponds to 1.0;
%w+ - Reset the Size attribute to its "normal" value.
%f...+ - Change the Font attribute for subsequent characters. The digits "..." give the new Font value.
%f+ - Reset the Font attribute to its "normal" value.
%c...+ - Change the Colour attribute for subsequent characters. The digits "..." give the new Colour value.
%c+ - Reset the Colour attribute to its "normal" value.
%t...+ - Change the Style attribute for subsequent characters. The digits "..." give the new Style value.
%t+ - Reset the Style attribute to its "normal" value.
%h+ - Remember the current horizontal position (see "%g+")
%g+ - Go to the horizontal position of the previous "%h+" (if any).
%- - Push the current graphics attribute values onto the top of the stack (see "%+").
%+ - Pop attributes values of the top the stack (see "%-"). If the stack is empty, "normal" attribute values are restored.
GrfEscape
public void setEscape(boolean escape)
If the Escape value of a Plot is one (the default), then any escape sequences in text strings produce the effects described below when printed. Otherwise, they are printed literally.
See also the GrfEscape.setEscapes(boolean)
function.
%% - Print a literal "%" character.
%^...+ - Draw subsequent characters as super-scripts. The digits "..." give the distance from the base-line of "normal" text to the base-line of the super-script text, scaled so that a value of "100" corresponds to the height of "normal" text. %^+ - Draw subsequent characters with the normal base-line.
%v...+ - Draw subsequent characters as sub-scripts. The digits "..." give the distance from the base-line of "normal" text to the base-line of the sub-script text, scaled so that a value of "100" corresponds to the height of "normal" text.
%v+ - Draw subsequent characters with the normal base-line (equivalent to %^+).
%>...+ - Leave a gap before drawing subsequent characters. The digits "..." give the size of the gap, scaled so that a value of "100" corresponds to the height of "normal" text.
%<...+ - Move backwards before drawing subsequent characters. The digits "..." give the size of the movement, scaled so that a value of "100" corresponds to the height of "normal" text.
%s...+ - Change the Size attribute for subsequent characters. The digits "..." give the new Size as a fraction of the "normal" Size, scaled so that a value of "100" corresponds to 1.0;
%s+ - Reset the Size attribute to its "normal" value.
%w...+ - Change the Width attribute for subsequent characters. The digits "..." give the new width as a fraction of the "normal" Width, scaled so that a value of "100" corresponds to 1.0;
%w+ - Reset the Size attribute to its "normal" value.
%f...+ - Change the Font attribute for subsequent characters. The digits "..." give the new Font value.
%f+ - Reset the Font attribute to its "normal" value.
%c...+ - Change the Colour attribute for subsequent characters. The digits "..." give the new Colour value.
%c+ - Reset the Colour attribute to its "normal" value.
%t...+ - Change the Style attribute for subsequent characters. The digits "..." give the new Style value.
%t+ - Reset the Style attribute to its "normal" value.
%h+ - Remember the current horizontal position (see "%g+")
%g+ - Go to the horizontal position of the previous "%h+" (if any).
%- - Push the current graphics attribute values onto the top of the stack (see "%+").
%+ - Pop attributes values of the top the stack (see "%-"). If the stack is empty, "normal" attribute values are restored.
escape
- the Escape attribute of this objectGrfEscape
public int getFont(String element)
The range of integer font indices available and the appearance of the resulting text is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default font supplied by this graphics system.
The available elements are:
In the default Grf implementation
(DefaultGrf
the submitted integer is mapped to a font using the
DefaultGrfFontManager
class.
element
- name of the graphical element for which the attribute
is to be gotDefaultGrf.attr(int, double, int)
public void setFont(String element, int font)
The range of integer font indices available and the appearance of the resulting text is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default font supplied by this graphics system.
The available elements are:
In the default Grf implementation
(DefaultGrf
the submitted integer is mapped to a font using the
DefaultGrfFontManager
class.
element
- name of the graphical element for which the attribute
is to be setfont
- the Font attribute for the indicated element of this
objectDefaultGrf.attr(int, double, int)
public int getFont()
The range of integer font indices available and the appearance of the resulting text is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default font supplied by this graphics system.
In the default Grf implementation
(DefaultGrf
the submitted integer is mapped to a font using the
DefaultGrfFontManager
class.
DefaultGrf.attr(int, double, int)
public void setFont(int font)
The range of integer font indices available and the appearance of the resulting text is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default font supplied by this graphics system.
In the default Grf implementation
(DefaultGrf
the submitted integer is mapped to a font using the
DefaultGrfFontManager
class.
font
- the Font attribute of this objectDefaultGrf.attr(int, double, int)
public double getGap(int axis)
The Gap value supplied will usually be rounded to the nearest "nice" value, suitable (e.g.) for generating axis labels, before use. To avoid this "nicing" you should set an explicit format for the axis using the Format(axis) or Digits/Digits(axis) attribute. The default behaviour is for the Plot to generate its own Gap value when required, based on the range of axis values to be represented.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setGap(int axis, double gap)
The Gap value supplied will usually be rounded to the nearest "nice" value, suitable (e.g.) for generating axis labels, before use. To avoid this "nicing" you should set an explicit format for the axis using the Format(axis) or Digits/Digits(axis) attribute. The default behaviour is for the Plot to generate its own Gap value when required, based on the range of axis values to be represented.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.gap
- the Gap attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setGap(double gap)
The Gap value supplied will usually be rounded to the nearest "nice" value, suitable (e.g.) for generating axis labels, before use. To avoid this "nicing" you should set an explicit format for the axis using the Format(axis) or Digits/Digits(axis) attribute. The default behaviour is for the Plot to generate its own Gap value when required, based on the range of axis values to be represented.
gap
- the Gap attribute of this objectpublic boolean getGrid()
If the Grid value of a Plot is non-zero, then grid lines will be drawn. Otherwise, short tick marks on the axes are used to mark the major axis values. The default behaviour is to use tick marks if the entire plotting area is filled by valid physical coordinates, but to draw grid lines otherwise.
public void setGrid(boolean grid)
If the Grid value of a Plot is non-zero, then grid lines will be drawn. Otherwise, short tick marks on the axes are used to mark the major axis values. The default behaviour is to use tick marks if the entire plotting area is filled by valid physical coordinates, but to draw grid lines otherwise.
grid
- the Grid attribute of this objectpublic boolean getInvisible()
If the Invisible value of a Plot is non-zero, then all the Plot methods which normally generate graphical output do not do so (you can think of them drawing with "invisible ink"). Such methods do, however, continue to do all the calculations which would be needed to produce the graphics. In particular, the bounding box enclosing the graphics is still calculated and can be retrieved as normal using astBoundingBox. The default value is zero, resulting in all methods drawing graphics as normal, using visible ink.
public void setInvisible(boolean invisible)
If the Invisible value of a Plot is non-zero, then all the Plot methods which normally generate graphical output do not do so (you can think of them drawing with "invisible ink"). Such methods do, however, continue to do all the calculations which would be needed to produce the graphics. In particular, the bounding box enclosing the graphics is still calculated and can be retrieved as normal using astBoundingBox. The default value is zero, resulting in all methods drawing graphics as normal, using visible ink.
invisible
- the Invisible attribute of this objectpublic double getLabelAt(int axis)
For each axis, the LabelAt value gives the value on the other axis at which numerical labels and tick marks should be placed (remember that Plots suitable for use with astGrid may only have two axes). For example, in a celestial (RA,Dec) coordinate system, LabelAt(1) gives a Dec value which defines a line (of constant Dec) along which the numerical RA labels and their associated tick marks will be drawn. Similarly, LabelAt(2) gives the RA value at which the Dec labels and ticks will be drawn.
The default bahaviour is for the Plot to generate its own position for numerical labels and tick marks.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLabelAt(int axis, double labelAt)
For each axis, the LabelAt value gives the value on the other axis at which numerical labels and tick marks should be placed (remember that Plots suitable for use with astGrid may only have two axes). For example, in a celestial (RA,Dec) coordinate system, LabelAt(1) gives a Dec value which defines a line (of constant Dec) along which the numerical RA labels and their associated tick marks will be drawn. Similarly, LabelAt(2) gives the RA value at which the Dec labels and ticks will be drawn.
The default bahaviour is for the Plot to generate its own position for numerical labels and tick marks.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.labelAt
- the LabelAt attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public boolean getLabelUnits(int axis)
If the LabelUnits value of a Plot axis is non-zero, a unit description will be included in the descriptive label for that axis, otherwise it will be omitted. The default behaviour is to include a unit description unless the current Frame of the Plot is a SkyFrame representing equatorial, ecliptic, galactic or supergalactic coordinates, in which case it is omitted.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLabelUnits(int axis, boolean labelUnits)
If the LabelUnits value of a Plot axis is non-zero, a unit description will be included in the descriptive label for that axis, otherwise it will be omitted. The default behaviour is to include a unit description unless the current Frame of the Plot is a SkyFrame representing equatorial, ecliptic, galactic or supergalactic coordinates, in which case it is omitted.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.labelUnits
- the LabelUnits attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLabelUnits(boolean labelUnits)
If the LabelUnits value of a Plot axis is non-zero, a unit description will be included in the descriptive label for that axis, otherwise it will be omitted. The default behaviour is to include a unit description unless the current Frame of the Plot is a SkyFrame representing equatorial, ecliptic, galactic or supergalactic coordinates, in which case it is omitted.
labelUnits
- the LabelUnits attribute of this objectpublic boolean getLabelUp(int axis)
If the LabelUp value of a Plot axis is non-zero, it causes numerical labels for that axis to be plotted upright (i.e. as normal, horizontal text), otherwise labels are drawn parallel to the axis to which they apply.
The default is to produce upright labels if the labels are placed around the edge of the plot, and to produce labels that follow the axes if the labels are placed within the interior of the plot (see attribute Labelling).
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLabelUp(int axis, boolean labelUp)
If the LabelUp value of a Plot axis is non-zero, it causes numerical labels for that axis to be plotted upright (i.e. as normal, horizontal text), otherwise labels are drawn parallel to the axis to which they apply.
The default is to produce upright labels if the labels are placed around the edge of the plot, and to produce labels that follow the axes if the labels are placed within the interior of the plot (see attribute Labelling).
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.labelUp
- the LabelUp attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLabelUp(boolean labelUp)
If the LabelUp value of a Plot axis is non-zero, it causes numerical labels for that axis to be plotted upright (i.e. as normal, horizontal text), otherwise labels are drawn parallel to the axis to which they apply.
The default is to produce upright labels if the labels are placed around the edge of the plot, and to produce labels that follow the axes if the labels are placed within the interior of the plot (see attribute Labelling).
labelUp
- the LabelUp attribute of this objectpublic String getLabelling()
If the Labelling value of a Plot is "exterior" (the default), then numerical labels and their associated tick marks are placed around the edges of the plotting area, if possible. If this is not possible, or if the Labelling value is "interior", then they are placed along grid lines inside the plotting area.
public void setLabelling(String labelling)
If the Labelling value of a Plot is "exterior" (the default), then numerical labels and their associated tick marks are placed around the edges of the plotting area, if possible. If this is not possible, or if the Labelling value is "interior", then they are placed along grid lines inside the plotting area.
labelling
- the Labelling attribute of this objectpublic double getLogGap(int axis)
The LogGap value supplied will be rounded to the nearest power of 10. The reciprocal of the supplied value may be used if this is necessary to produce usable major axis values. If a zero or negative value is supplied, an error will be reported when the grid is drawn. The default behaviour is for the Plot to generate its own LogGap value when required, based on the range of axis values to be represented.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLogGap(int axis, double logGap)
The LogGap value supplied will be rounded to the nearest power of 10. The reciprocal of the supplied value may be used if this is necessary to produce usable major axis values. If a zero or negative value is supplied, an error will be reported when the grid is drawn. The default behaviour is for the Plot to generate its own LogGap value when required, based on the range of axis values to be represented.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.logGap
- the LogGap attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLogGap(double logGap)
The LogGap value supplied will be rounded to the nearest power of 10. The reciprocal of the supplied value may be used if this is necessary to produce usable major axis values. If a zero or negative value is supplied, an error will be reported when the grid is drawn. The default behaviour is for the Plot to generate its own LogGap value when required, based on the range of axis values to be represented.
logGap
- the LogGap attribute of this objectpublic boolean getLogLabel(int axis)
The default is to produce exponential labels if the major tick marks are logarithmically spaced (see the LogTicks attribute).
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLogLabel(int axis, boolean logLabel)
The default is to produce exponential labels if the major tick marks are logarithmically spaced (see the LogTicks attribute).
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.logLabel
- the LogLabel attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLogLabel(boolean logLabel)
The default is to produce exponential labels if the major tick marks are logarithmically spaced (see the LogTicks attribute).
logLabel
- the LogLabel attribute of this objectpublic boolean getLogPlot(int axis)
If the LogPlot value of a Plot axis is non-zero, it causes that axis to be mapped logarithmically, otherwise (the default) the axis is mapped linearly.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLogPlot(int axis, boolean logPlot)
If the LogPlot value of a Plot axis is non-zero, it causes that axis to be mapped logarithmically, otherwise (the default) the axis is mapped linearly.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.logPlot
- the LogPlot attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLogPlot(boolean logPlot)
If the LogPlot value of a Plot axis is non-zero, it causes that axis to be mapped logarithmically, otherwise (the default) the axis is mapped linearly.
logPlot
- the LogPlot attribute of this objectpublic boolean getLogTicks(int axis)
If the LogTicks value for a physical axis is non-zero, the major tick marks on that axis will be spaced logarithmically (that is, there will be a constant ratio between the axis values at adjacent major tick marks). An error will be reported if the dynamic range of the axis (the ratio of the largest to smallest displayed axis value) is less than 10.0. If the LogTicks value is zero, the major tick marks will be evenly spaced (that is, there will be a constant difference between the axis values at adjacent major tick marks). The default is to produce logarithmically spaced tick marks if the corresponding LogPlot attribute is non-zero and the ratio of maximum axis value to minimum axis value is 100 or more. If either of these conditions is not met, the default is to produce linearly spaced tick marks.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLogTicks(int axis, boolean logTicks)
If the LogTicks value for a physical axis is non-zero, the major tick marks on that axis will be spaced logarithmically (that is, there will be a constant ratio between the axis values at adjacent major tick marks). An error will be reported if the dynamic range of the axis (the ratio of the largest to smallest displayed axis value) is less than 10.0. If the LogTicks value is zero, the major tick marks will be evenly spaced (that is, there will be a constant difference between the axis values at adjacent major tick marks). The default is to produce logarithmically spaced tick marks if the corresponding LogPlot attribute is non-zero and the ratio of maximum axis value to minimum axis value is 100 or more. If either of these conditions is not met, the default is to produce linearly spaced tick marks.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.logTicks
- the LogTicks attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setLogTicks(boolean logTicks)
If the LogTicks value for a physical axis is non-zero, the major tick marks on that axis will be spaced logarithmically (that is, there will be a constant ratio between the axis values at adjacent major tick marks). An error will be reported if the dynamic range of the axis (the ratio of the largest to smallest displayed axis value) is less than 10.0. If the LogTicks value is zero, the major tick marks will be evenly spaced (that is, there will be a constant difference between the axis values at adjacent major tick marks). The default is to produce logarithmically spaced tick marks if the corresponding LogPlot attribute is non-zero and the ratio of maximum axis value to minimum axis value is 100 or more. If either of these conditions is not met, the default is to produce linearly spaced tick marks.
logTicks
- the LogTicks attribute of this objectpublic double getMajTickLen(int axis)
The MajTickLen value should be given as a fraction of the minimum dimension of the plotting area. Negative values cause major tick marks to be placed on the outside of the corresponding grid line or axis (but subject to any clipping imposed by the underlying graphics system), while positive values cause them to be placed on the inside.
The default behaviour depends on whether a coordinate grid is drawn inside the plotting area (see the Grid attribute). If so, the default MajTickLen value is zero (so that major ticks are not drawn), otherwise the default is +0.015.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setMajTickLen(int axis, double majTickLen)
The MajTickLen value should be given as a fraction of the minimum dimension of the plotting area. Negative values cause major tick marks to be placed on the outside of the corresponding grid line or axis (but subject to any clipping imposed by the underlying graphics system), while positive values cause them to be placed on the inside.
The default behaviour depends on whether a coordinate grid is drawn inside the plotting area (see the Grid attribute). If so, the default MajTickLen value is zero (so that major ticks are not drawn), otherwise the default is +0.015.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.majTickLen
- the MajTickLen attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setMajTickLen(double majTickLen)
The MajTickLen value should be given as a fraction of the minimum dimension of the plotting area. Negative values cause major tick marks to be placed on the outside of the corresponding grid line or axis (but subject to any clipping imposed by the underlying graphics system), while positive values cause them to be placed on the inside.
The default behaviour depends on whether a coordinate grid is drawn inside the plotting area (see the Grid attribute). If so, the default MajTickLen value is zero (so that major ticks are not drawn), otherwise the default is +0.015.
majTickLen
- the MajTickLen attribute of this objectpublic double getMinTickLen(int axis)
The MinTickLen value should be given as a fraction of the minimum dimension of the plotting area. Negative values cause minor tick marks to be placed on the outside of the corresponding grid line or axis (but subject to any clipping imposed by the underlying graphics system), while positive values cause them to be placed on the inside.
The default value is +0.007.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setMinTickLen(int axis, double minTickLen)
The MinTickLen value should be given as a fraction of the minimum dimension of the plotting area. Negative values cause minor tick marks to be placed on the outside of the corresponding grid line or axis (but subject to any clipping imposed by the underlying graphics system), while positive values cause them to be placed on the inside.
The default value is +0.007.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.minTickLen
- the MinTickLen attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setMinTickLen(double minTickLen)
The MinTickLen value should be given as a fraction of the minimum dimension of the plotting area. Negative values cause minor tick marks to be placed on the outside of the corresponding grid line or axis (but subject to any clipping imposed by the underlying graphics system), while positive values cause them to be placed on the inside.
The default value is +0.007.
minTickLen
- the MinTickLen attribute of this objectpublic int getMinTick(int axis)
The value supplied should be the number of minor divisions required between each pair of major axis values, this being one more than the number of minor tick marks to be drawn. By default, a value is chosen that depends on the gap between major axis values and the nature of the axis.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setMinTick(int axis, int minTick)
The value supplied should be the number of minor divisions required between each pair of major axis values, this being one more than the number of minor tick marks to be drawn. By default, a value is chosen that depends on the gap between major axis values and the nature of the axis.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.minTick
- the MinTick attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setMinTick(int minTick)
The value supplied should be the number of minor divisions required between each pair of major axis values, this being one more than the number of minor tick marks to be drawn. By default, a value is chosen that depends on the gap between major axis values and the nature of the axis.
minTick
- the MinTick attribute of this objectpublic boolean getNumLab(int axis)
If the NumLab value of a Plot axis is non-zero (the default), then numerical labels will be drawn for that axis, otherwise they will be omitted.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setNumLab(int axis, boolean numLab)
If the NumLab value of a Plot axis is non-zero (the default), then numerical labels will be drawn for that axis, otherwise they will be omitted.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.numLab
- the NumLab attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setNumLab(boolean numLab)
If the NumLab value of a Plot axis is non-zero (the default), then numerical labels will be drawn for that axis, otherwise they will be omitted.
numLab
- the NumLab attribute of this objectpublic double getNumLabGap(int axis)
For each axis, the NumLabGap value gives the spacing between the axis line (or edge of the plotting area, if appropriate) and the nearest edge of the corresponding numerical axis labels. Positive values cause the descriptive label to be placed on the opposite side of the line to the default tick marks, while negative values cause it to be placed on the same side.
The NumLabGap value should be given as a fraction of the minimum dimension of the plotting area, the default value being +0.01.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setNumLabGap(int axis, double numLabGap)
For each axis, the NumLabGap value gives the spacing between the axis line (or edge of the plotting area, if appropriate) and the nearest edge of the corresponding numerical axis labels. Positive values cause the descriptive label to be placed on the opposite side of the line to the default tick marks, while negative values cause it to be placed on the same side.
The NumLabGap value should be given as a fraction of the minimum dimension of the plotting area, the default value being +0.01.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.numLabGap
- the NumLabGap attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setNumLabGap(double numLabGap)
For each axis, the NumLabGap value gives the spacing between the axis line (or edge of the plotting area, if appropriate) and the nearest edge of the corresponding numerical axis labels. Positive values cause the descriptive label to be placed on the opposite side of the line to the default tick marks, while negative values cause it to be placed on the same side.
The NumLabGap value should be given as a fraction of the minimum dimension of the plotting area, the default value being +0.01.
numLabGap
- the NumLabGap attribute of this objectpublic double getSize(String element)
The range of character sizes available and the appearance of the resulting text is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default character size supplied by this graphics system.
The available elements are:
The implementation of this method is determined by the current Grf object.
element
- name of the graphical element for which the attribute
is to be gotDefaultGrf.attr(int, double, int)
public void setSize(String element, double size)
The range of character sizes available and the appearance of the resulting text is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default character size supplied by this graphics system.
The available elements are:
The implementation of this method is determined by the current Grf object.
element
- name of the graphical element for which the attribute
is to be setsize
- the Size attribute for the indicated element of this
objectDefaultGrf.attr(int, double, int)
public double getSize()
The range of character sizes available and the appearance of the resulting text is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default character size supplied by this graphics system.
The implementation of this method is determined by the current Grf object.
DefaultGrf.attr(int, double, int)
public void setSize(double size)
The range of character sizes available and the appearance of the resulting text is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default character size supplied by this graphics system.
The implementation of this method is determined by the current Grf object.
size
- the Size attribute of this objectDefaultGrf.attr(int, double, int)
public int getStyle(String element)
The range of integer line styles available and their appearance is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default line style supplied by this graphics system (normally, this is likely to give a solid line).
The available elements are:
The available line styles are defined by the Grf object being used to
implement the graphics
(by default DefaultGrf
).
element
- name of the graphical element for which the attribute
is to be gotDefaultGrf.attr(int, double, int)
public void setStyle(String element, int style)
The range of integer line styles available and their appearance is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default line style supplied by this graphics system (normally, this is likely to give a solid line).
The available elements are:
The available line styles are defined by the Grf object being used to
implement the graphics
(by default DefaultGrf
).
element
- name of the graphical element for which the attribute
is to be setstyle
- the Style attribute for the indicated element of this
objectDefaultGrf.attr(int, double, int)
public void setStyle(int style)
The range of integer line styles available and their appearance is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default line style supplied by this graphics system (normally, this is likely to give a solid line).
The available line styles are defined by the Grf object being used to
implement the graphics
(by default DefaultGrf
).
style
- the Style attribute of this objectDefaultGrf.attr(int, double, int)
public boolean getTextLab(int axis)
If the TextLab value of a Plot axis is non-zero, then descriptive labels will be drawn for that axis, otherwise they will be omitted. The default behaviour is to draw descriptive labels if tick marks and numerical labels are being drawn around the edges of the plotting area (see the Labelling attribute), but to omit them otherwise.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setTextLab(int axis, boolean textLab)
If the TextLab value of a Plot axis is non-zero, then descriptive labels will be drawn for that axis, otherwise they will be omitted. The default behaviour is to draw descriptive labels if tick marks and numerical labels are being drawn around the edges of the plotting area (see the Labelling attribute), but to omit them otherwise.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.textLab
- the TextLab attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setTextLab(boolean textLab)
If the TextLab value of a Plot axis is non-zero, then descriptive labels will be drawn for that axis, otherwise they will be omitted. The default behaviour is to draw descriptive labels if tick marks and numerical labels are being drawn around the edges of the plotting area (see the Labelling attribute), but to omit them otherwise.
textLab
- the TextLab attribute of this objectpublic double getTextLabGap(int axis)
For each axis, the TextLabGap value gives the spacing between the descriptive label and the edge of a box enclosing all other parts of the annotated grid (excluding other descriptive labels). The gap is measured to the nearest edge of the label (i.e. the top or the bottom). Positive values cause the descriptive label to be placed outside the bounding box, while negative values cause it to be placed inside.
The TextLabGap value should be given as a fraction of the minimum dimension of the plotting area, the default value being +0.01.
axis
- index of the axis for which the attribute is to be got.
Must be >= 1 and <= the value of the Naxes
attribute.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setTextLabGap(int axis, double textLabGap)
For each axis, the TextLabGap value gives the spacing between the descriptive label and the edge of a box enclosing all other parts of the annotated grid (excluding other descriptive labels). The gap is measured to the nearest edge of the label (i.e. the top or the bottom). Positive values cause the descriptive label to be placed outside the bounding box, while negative values cause it to be placed inside.
The TextLabGap value should be given as a fraction of the minimum dimension of the plotting area, the default value being +0.01.
axis
- index of the axis for which the attribute is to be set.
Must be >= 1 and <= the value of the Naxes
attribute.textLabGap
- the TextLabGap attribute for the indicated axis
of this object.IndexOutOfBoundsException
- if axis
is not in the
range 1..Naxes
public void setTextLabGap(double textLabGap)
For each axis, the TextLabGap value gives the spacing between the descriptive label and the edge of a box enclosing all other parts of the annotated grid (excluding other descriptive labels). The gap is measured to the nearest edge of the label (i.e. the top or the bottom). Positive values cause the descriptive label to be placed outside the bounding box, while negative values cause it to be placed inside.
The TextLabGap value should be given as a fraction of the minimum dimension of the plotting area, the default value being +0.01.
textLabGap
- the TextLabGap attribute of this objectpublic boolean getTickAll()
If the TickAll value of a Plot is non-zero (the default), then tick marks will be drawn on all edges of the Plot. Otherwise, they will be drawn only on those edges where the numerical and descriptive axis labels are drawn (see the Edge(axis) attribute).
public void setTickAll(boolean tickAll)
If the TickAll value of a Plot is non-zero (the default), then tick marks will be drawn on all edges of the Plot. Otherwise, they will be drawn only on those edges where the numerical and descriptive axis labels are drawn (see the Edge(axis) attribute).
tickAll
- the TickAll attribute of this objectpublic double getTitleGap()
Its value gives the spacing between the bottom edge of the title and the top edge of a bounding box containing all the other parts of the annotated grid. Positive values cause the title to be drawn outside the box, while negative values cause it to be drawn inside.
The TitleGap value should be given as a fraction of the minimum dimension of the plotting area, the default value being +0.05.
public void setTitleGap(double titleGap)
Its value gives the spacing between the bottom edge of the title and the top edge of a bounding box containing all the other parts of the annotated grid. Positive values cause the title to be drawn outside the box, while negative values cause it to be drawn inside.
The TitleGap value should be given as a fraction of the minimum dimension of the plotting area, the default value being +0.05.
titleGap
- the TitleGap attribute of this objectpublic double getTol()
The Tol value should be given as a fraction of the minimum dimension of the plotting area, and should lie in the range from 1.0e-7 to 1.0. By default, a value of 0.01 is used.
public void setTol(double tol)
The Tol value should be given as a fraction of the minimum dimension of the plotting area, and should lie in the range from 1.0e-7 to 1.0. By default, a value of 0.01 is used.
tol
- the Tol attribute of this objectpublic double getWidth(String element)
The actual appearance of lines drawn with any particular width, and the range of available widths, is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default line width supplied by this graphics system. This will not necessarily correspond to a Width value of 1.0.
The available elements are:
The implementation of this method is determined by the current Grf object.
element
- name of the graphical element for which the attribute
is to be gotDefaultGrf.attr(int, double, int)
public void setWidth(String element, double width)
The actual appearance of lines drawn with any particular width, and the range of available widths, is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default line width supplied by this graphics system. This will not necessarily correspond to a Width value of 1.0.
The available elements are:
The implementation of this method is determined by the current Grf object.
element
- name of the graphical element for which the attribute
is to be setwidth
- the Width attribute for the indicated element of this
objectDefaultGrf.attr(int, double, int)
public void setWidth(double width)
The actual appearance of lines drawn with any particular width, and the range of available widths, is determined by the underlying graphics system. The default behaviour is for all graphical elements to be drawn using the default line width supplied by this graphics system. This will not necessarily correspond to a Width value of 1.0.
The implementation of this method is determined by the current Grf object.
width
- the Width attribute of this objectDefaultGrf.attr(int, double, int)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.