AxisObject
AxisObject[path]
is a Graphics primitive that represents an axis with a quantitative scale along the path path.
AxisObject[path,scale]
uses the scale specified by scale.
Details and Options
- AxisObject[…] represents a generalized axis that can be placed in arbitrary graphics.
- An axis consists of a path, which determines where the axis is drawn; the scale, which controls how coordinates in the graphic are mapped to values along the path; and options that affect the detailed appearance of the axis, ticks and labels.
- Possible settings for path include:
-
{pt1,pt2} axis through the points pt1 and pt2 {"Horizontal",y0} horizontal axis through {"Horizontal",y0,{xmin,xmax}} horizontal axis from to {"Vertical",x0} vertical axis through {"Vertical",x0,{ymin,ymax}} vertical axis from to InfiniteLine[{pt1,pt2}] infinite axis through points pt1 and pt2 InfiniteLine[pt,v] infinite axis passing through the point pt in the direction v Line[{pt1,pt2}] finite axis from point pt1 to point pt2 Line[{pt1,…,ptn}] curve axis from point pt1 to point ptn HalfLine[{pt1,pt2}] half-axis from the point pt1 through pt2 HalfLine[pt,v] half-axis from point pt in the direction v BSplineCurve[…] axis along the given B-spline curve BezierCurve[…] axis along the given Bézier curve Circle[…] axis along the given circle or arc - Infinite forms of axes draw to the edges of the graphic.
- By default, "Horizontal" and "Vertical" axes use the natural scale where the axis values correspond to the vertical and horizontal components of the underlying graphics coordinates.
- Possible settings for scale include:
-
{val1,val2} use val1 at the start of the axis and val2 at the end {loc1val1,loc2val2} use val1 and val2 at locations loc1 and loc2 - For infinite axes, the "start" and "end" points are taken to be pt1 and pt2.
- For "Horizontal" and "Vertical" axes, the locations loci can be specified as x and y coordinates.
- The locations loci used to define the value scale for an axis do not have to be visually present in the graphic.
- If the location loci is not on the axis, it will be projected to the nearest point that is.
- Possible options for AxisObject are:
-
AxisLabel None how to label the axis AxisStyle {} how to style the axis path BaseStyle {} general style for the axis LabelStyle {} how to style labels RotateLabel False how to rotate axis labels TickDirection Automatic on which side of the axis to place ticks TickLabelOrientation None how to rotate tick labels TickLabelPositioning Automatic where to place tick labels TickLabels Automatic how to label ticks TickLengths Automatic how long to draw ticks TickPositions Automatic where to place ticks along the axis Ticks Automatic individual ticks TicksStyle {} how to style ticks - Settings for tick and label options are generally either of the form optspec, which uses spec for all the ticks and labels, or of the form opt{spec1,…,specn}, where the speci correspond to collections of settings for corresponding collections of ticks and labels.
- Axes are typically drawn with two sets of ticks: "major" ticks that are longer and have labels and "minor" ticks that are shorter and unlabeled.
- By default, axis labels are placed at the end of the axis.
- AxisLabelPlaced[label,pos] can be used to specify where the axis label should be placed.
- Placed can use the following positions pos:
-
"Start" the start of the axis "End" the end of the axis Center centered along the axis Above,Below,Before,After placed relative to the axis - Possible settings for speci for TickPositions are:
-
Automatic automatically compute ticks n use approximately n ticks {dx} use ticks that are multiples of dx {min,max,dx} use ticks from min to max in steps of dx {{t1,t2,…,tm}} use specific ticks ti - Possible settings for speci for TickLabels are:
-
Automatic automatically label ticks All include labels None omit labels {lab1,lab2,…,labm} use labi to label position ti - The Automatic setting for TickLabels is All for spec1 and None otherwise.
- The settings for speci in TickLengths are:
-
Automatic automatic lengths None omit the tick marker Scaled[s] use a scaled length Offset[s] use an absolute length "Major" use the default length for major ticks "Minor" use the default length for minor ticks Tiny,Small,Medium,Large named lengths - TickDirectiondir specifies in what direction dir the ticks should be drawn relative to the axis.
-
Automatic automatically chosen direction "Inward" toward the center of the graphic "Outward" away from the center of the graphic "InwardOutward" crosses over axis Left to the left Right to the right Up toward the top Down toward the bottom - TickLabelPositioningpos specifies the position pos where tick labels should be drawn relative to the tick.
- Possible settings for pos include:
-
"Base" at the base of the tick where it meets the axis "Tip" at the tip of the tick Before end of the label before the tick After start of the label after the tick - Possible settings for RotateLabel and TickLabelOrientation include:
-
None, "Horizontal" do not rotate labels "Vertical" rotate labels 90° counterclockwise "Parallel" rotate labels to be parallel to the axis "Perpendicular" rotate labels to be perpendicular to the axis θ rotate labels counterclockwise from horizontal by angle
Examples
open allclose allBasic Examples (4)
Scope (9)
Axis Placement and Scales (6)
Use a finite line for an axis:
Use an infinite line through two points, whose values are 0 and 10:
Use a point and direction to define the infinite line:
Use a half-line through two points:
Use a point and direction to define the half-line:
Use a Bézier curve as the path for an axis:
Change the values at the endpoints:
Use a B-spline curve as the path for an axis:
Change the values at the endpoints:
Tick Placement (3)
Options (39)
AxisLabel (4)
AxisStyle (3)
AxisStyle affects only the style of the axis path:
AxisStyleTransparent will hide the axis curve, leaving only the ticks and labels:
AxisStyle inherits from the overall base style for the axis:
BaseStyle (3)
AxisStyle affects only the style of the axis path:
TicksStyle affects the style of the ticks, including their labels:
LabelStyle (4)
LabelStyle affects only the style of the labels:
Use LabelStylesize to specify the font size for the labels:
Specify a font and font size for the labels:
LabelStyle inherits from the overall base style for the axis:
TickDirection (4)
TickLabels (3)
TickLabelOrientation (5)
TickLabelPositioning (2)
TickLengths (3)
TickPositions (5)
TicksStyle (3)
TicksStyle styles both the tick marks and labels:
Use different styles for different collections of ticks:
TicksStyle inherits from the overall base style for the axis:
Text
Wolfram Research (2021), AxisObject, Wolfram Language function, https://reference.wolfram.com/language/ref/AxisObject.html.
CMS
Wolfram Language. 2021. "AxisObject." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AxisObject.html.
APA
Wolfram Language. (2021). AxisObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AxisObject.html