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 Nonehow to label the axis
    AxisStyle {}how to style the axis path
    BaseStyle {}general style for the axis
    LabelStyle {}how to style labels
    RotateLabelFalsehow to rotate axis labels
    TickDirection Automaticon which side of the axis to place ticks
    TickLabelOrientation Nonehow to rotate tick labels
    TickLabelPositioning Automaticwhere to place tick labels
    TickLabels Automatichow to label ticks
    TickLengths Automatichow long to draw ticks
    TickPositions Automaticwhere to place ticks along the axis
    TicksAutomaticindividual 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
    Centercentered along the axis
    Above,Below,Before,Afterplaced relative to the axis
  • Possible settings for speci for TickPositions are:
  • Automaticautomatically compute ticks
    nuse 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:
  • Automaticautomatically label ticks
    Allinclude labels
    Noneomit 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:
  • Automaticautomatic lengths
    Noneomit 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,Largenamed lengths
  • TickDirectiondir specifies in what direction dir the ticks should be drawn relative to the axis.
  • Automaticautomatically chosen direction
    "Inward"toward the center of the graphic
    "Outward"away from the center of the graphic
    "InwardOutward"crosses over axis
    Leftto the left
    Rightto the right
    Uptoward the top
    Downtoward 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
    Beforeend of the label before the tick
    Afterstart 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 all

Basic Examples  (4)

Place a horizontal axis at :

Limit the axis so that is between and 1:

Construct several vertical axes:

Construct an axis that is 0 at the point and 1 at the point :

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:

Construct an axis along an arbitrary curve:

Specify the values at the endpoints:

Tick Placement  (3)

Use approximately five ticks on the axis:

Further subdivide the axis into approximately five minor ticks per major interval:

Place ticks at positions from to 5 in steps of 1:

Include minor ticks at multiples of 0.2:

Place ticks at specific locations:

Include minor ticks at multiples of 1:

Options  (39)

AxisLabel  (4)

The label is placed at the end of the axis by default:

Label the start of the axis:

Place the label close to the axis above or below it:

Before and after the axis:

Center the label along the axis:

Rotate the label to be parallel to the axis:

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)

Construct a red axis:

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)

By default, ticks point up and to the right:

Point all the ticks toward the center of the graphic:

Point all the ticks away from the center of the graphic:

Use ticks that point to the left or right:

Use ticks that point up or down:

TickLabels  (3)

Ticks are automatically labeled by default:

Use automatic labels for the first collection of ticks and no labels for the second:

Reverse the labeling of tick collections:

Use specific labels for each tick:

TickLabelOrientation  (5)

Tick labels are horizontal by default:

Rotate the labels 90° so that they read bottom to top:

Rotate the labels so that the text is parallel to the axis:

Rotate the labels so that the text is perpendicular to the axis:

Rotate the labels by an arbitrary angle:

TickLabelPositioning  (2)

Tick labels are placed at the base of the tick by default:

Place the labels at the tip of the tick:

TickLengths  (3)

Use the default lengths for major and minor ticks:

Use a scaled length for all the ticks:

Use different tick lengths for different collections of ticks:

TickPositions  (5)

Use approximately six ticks along the axis:

Use major and minor ticks:

Use ticks at integer positions along the axis:

Specify the lower and upper bounds for the ticks:

Give a list of specific tick locations for the axis:

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:

Applications  (2)

Create a ruler labeled down to the quarter-inch:

Use three axes to construct a frame for ternary plots:

Create a ternary list plot:

Wolfram Research (2021), AxisObject, Wolfram Language function, https://reference.wolfram.com/language/ref/AxisObject.html.

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

BibTeX

@misc{reference.wolfram_2024_axisobject, author="Wolfram Research", title="{AxisObject}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/AxisObject.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_axisobject, organization={Wolfram Research}, title={AxisObject}, year={2021}, url={https://reference.wolfram.com/language/ref/AxisObject.html}, note=[Accessed: 21-November-2024 ]}