3.7.5.27 Layer.Axis

The Axis object is a sub-object of the layer object. The axis object also contains sub-objects: Breaks, Grid, and Label. You can use range notation to define a layer object:

range layerObject = [pageName]layerName!

And then access the axis object by:

layerObject.Axis.property

Where Axis is the axis specification: X is the bottom X axis, X2 is the top X axis, Y is the left Y axis, Y2 is the right Y axis, Z is the front Z axis, Z2 is the back Z axis, Zh is the ZhX axis, Zh2 is the back ZhY axis, and Zh3 is the back ZhZ axis.

In Radar Chart, YN is the Nth radar axis, for instance, Y3 is the third radar axis counted clockwisely from the default labeled axis (Y1).


Properties

Here, axis is a placeholder for x, y or z and axis2 is a placeholder for x2, y2 or z2.

Property Access Description
layer.axis.adj

(2021b)

Read/write
numeric

For 2D ternary coordinate, show the opposite axis on the parallel axis or adjacent axis :
1 = show on adjacent axis;
0 = show on parallel axis of current axis.
Note: This property is equal to Opposite Axis Show at option in the Scale tab of Axis dialog for Ternary graphs.

layer.axis.arrow

For more sub-object of the axis arrow object, please see this page.

layer.axis.arrow.show Read/write
numeric

Show the arrow at end/begin/both of axis
0=not show arrow;
1= show at the end of axis;
2= show at the begin of axis;
3= show at the both of the axis

layer.axis.atZero Read/write
numeric

Display a straight line at Y = 0 for an X axis, X = 0 for a Y axis: 1 = show, 0 = hide.
Note: This property is NOT supported in 3D graph.

layer.axis.BarBreakBorder

(2020b)

Read/write
numeric

For column and bar chart, if layer.ais.PlotBreakSymbol is turned on, layer.axis.BarBreakBorder can further determine whether the break marker is plotted at both borders of the bar. 0 = the break marker is plotted across the entire bar, 1 = the marker is plotted at both borders.

layer.axis.breaks

For more sub-object of the breaks object, please see this page.

layer.axis.color Read/write
numeric

Axis color. Numbers from the color list, or transparent (0). The color function can be used, as in: layer.x.color = color(blue); or layer.y2.color = color(240,208,0);

layer.axis.decPlaces Read/write
numeric

Set the number of decimal places displayed in the tick labels.

layer.axis.firstTick Read/write
numeric

First tick value.

layer.axis.formula$ Read/write
string

Set custom direct formula when scale type is "Custom Formula".

layer.axis.from Read/write
numeric

First axis scale value. If the data is date format, you have to use the corresponding Julian days instead. To convert to Julian days, refer to Date.

layer.axis.grid

For more sub-object of the grid object, please see this page.

layer.axis.grid.show Read/write
numeric

Show the grid lines
0=not show grid lines;
1= show the major grid lines;
2= show the minor grid lines;
3= show both major and minor grid lines;

layer.axis.inc Read/write
numeric

Major tick increment.

layer.axis.IndivScale

(2023)

Read/write
numeric

Only support for Y axis.

When there are two Y axes shows, specfify whether alllow to rescale each Y independently:

layer.y.IndivScale = 1; 
//1 = Turn on to rescale left Y and right Y independently;  0=Right Y and left Y share same axis scale.
layer.axis.invformula$ Read/write
string

Set custom inverse formula when scale type is "Custom Formula".

layer.axis.label

For more sub-object of the label object, please see this page.

layer.axis.labelSubtype Read/write
numeric

Tick label format: 1 = decimal, 2 = scientific, 3 = engineering (1K), and 4 = decimal (1,000).

layer.axis.labelText$ Read/write
string

Dataset name if the tick label is text from dataset. To read, assign the value to a string variable.

layer.axis.labelType Read/write
numeric

Tick label type: 1 = numeric, 2 = text from dataset, etc.

layer.axis.link

(2023b)

Read/write
numeric

Link type for the specified axis residing in a layer that is linked with the layer.link property.
0 = no link;
1 = one-to-one link;
3 = Align mode

This property is NOT supported in 3D graph.

layer.axis.link.from$

(2015 SR0)

Read/write
string

Custom linking From value formula for child layer X/Y scale in terms of the parent layer scale value(s). The parent layer From and To scale values syntax for X and Y axis are X1, X2, Y1, Y2 respectively.

When layer.axis.link=3, the specified axis will align to another axis of same direction at specified axis position; this axis postion for alignment can be specified by layer.axis.link.from$. For Example

//Align right Y to left Y at Y = 0
layer.y2.link = 3; // mode=align
layer.y2.link.from$ = 0; // axis position value=0
layer.axis.link.to$

(2015 SR0)

Read/write
string

Custom linking To value formula for child layer X/Y scale in terms of the parent layer scale value(s). The parent layer From and To scale values syntax for X and Y axis are X1, X2, Y1, Y2 respectively.

layer.axis.majorTicks Read/write
numeric

Number of major ticks. The default value of 0 is ignored. Setting this to a positive number will result in approximately that number of major ticks.

layer.axis.minorTicks Read/write
numeric

Number of minor ticks.

layer.axis.mticklength Read/write
numeric

Minor tick length.

layer.axis.mtickthickness Read/write
numeric

Minor tick thickness.

layer.axis.opposite Read/write
numeric

Line opposite the axis: 1 = enable, 0 = disable.

This property is NOT supported in 3D graph.

layer.axis.PlotBreakSymbol

(2020b)

Read/write
numeric

Add break marker to plot 0 = do not show break marker on the plot, only a gap at the axis break region, 1 = show break marker on the plot, the marker shape follows the shape of axis break

layer.axis.postype Read/write
numeric

Axis position: 0 = "Default position", 1 = "% from left", 2 = "At position ="

Note: When layer.axis.postype is set to 1 or 2, please work with layer.axis.position to specify the percent/value
Example:

//Offset the y axis to be 20% of the axis length left from its default position
layer.y.postype=1;
layer.y.position=20;
layer.axis.position Read/write
numeric

Specify the axis position value. It is only available when layer.axis.postype = 1 or = 2.

layer.axis.rescale Read/write
numeric

Rescale type: 1 = manual, 2 = normal, 3 = auto, 4 = fixed from, and 5 = fixed to.

layer.axis.rescaleMargin Read/write
numeric

% of data range used to produce a margin around data. Select Plot:Rescale to Show All to view the change.

layer.axis.rescaleperiod Read/write
numeric

Specify whether rescale the angular axis when Unit=Custom for a polar graph.
If there are points outside of original custom unit range, setting this object to 1, the angular axis range will be updated when you rescale the axis.
Default value is 0, which means the angular axis range won't rescale for custom unit.

layer.axis.reverse Read/write
numeric

Reverse axis direction: 1 = enable, 0 = disable.

Note:This property is supported in 3D OpenGL graph, but it can NOT work when close OpenGL (@ogl=0).

layer.axis.showAxes Read/write
numeric

Axis and tick display: 0 = hide both axes, 1 = show left, bottom or front axis, 2 = show right, top or back axis, 3 = show both axes. axis and axis2 are the same.

layer.axis.showGrids Read/write
numeric

Grid display: 0 = hide grids, 1 = show major grids, 2 = show minor grids, and 3 = show both grids. axis and axis2 are the same.

layer.axis.showlabel

(2020)

Read/write
numeric

Show tick labels on sepcified axis: 0 = hide labels, 1 = show labels.

layer.axis.showLabels Read/write
numeric

Show tick labels on axes: 0 = hide both labels, 1 = show left or bottom axis, 2 = show right or top labels, 3 = show both labels. axis and axis2 are the same.

layer.axis.showopposite

(2020)

Read/write
numeric

Show opposite axis line of the specified axis: 0 = hide opposite axis, 1 = show opposite axis.

layer.axis.space Read/write
numeric

Same as layer.axis.type.

layer.axis.thickness Read/write
numeric

Width of axis line in points.

layer.axis.ticklength Read/write
numeric

Major tick length.

layer.axis.ticks Read/write
numeric

Controls the major and minor ticks as follows: 0 = no ticks, 1 = major in, 2 = major out, 4 = minor in, and 8 = minor out. Numbers can be combined, so 1 + 2 + 8 = 11 (major ticks in and out, minor ticks out).

layer.axis.TicksByData$ Read/write
numeric

Specifies a dataset to control major ticks mark position and labels.

Note: You can use an existing dataset or type a series of numbers separated by Space.

layer.axis.mticksbydata$ Read/write
numeric

Specifies a dataset to control minor ticks mark position and labels.

Note: You can use an existing dataset or type a series of numbers separated by Space.

layer.axis.tickthickness Read/write
numeric

Major tick thickness.

layer.axis.to Read/write
numeric

Last axis scale value. If the data is date format, you have to use the corresponding Julian days instead. To convert to Julian days, refer to Date.

layer.axis.type Read/write
numeric

Axis scale type: 0 or 1 = linear, 2 = log10, 3 = probability, 4 = probit, 5 = reciprocal, 6 = offset reciprocal, 7 = logit, 8 = ln, 9 = log2, 10 = Double Log Reciprocal and 11 = Custom Formula.

layer.axis.whiteout Read/write
numeric

White out around tick labels: 1 = enable, 0 = disable.


Examples

This script is used to set the first value of bottom X axis for date data:

layer.x.from = date(1/7/2014 04:46:06, 2);


This script types the first value of the left Y axis to the Script window in the second layer of the graph1 window:

range ll = [graph1]2!;
ll.y.from= ;


This script sets the major ticks out and minor ticks in for the top X axis in the active layer:

range ll = !;
ll.x2.ticks = 6;


This script specifies the custom linking formulae for linked layers:

layer.x.link.from$ = "X1-X2";
layer.x.link.to$ = "X1+X2";


This script specifies a dataset to control X axis major tick mark positions and labels:

//Control major ticks show mark 1, 4, 9 and 17 position, and show labels.
layer.x.ticksbydata$="1 4 9 17";

//If want to use a defined dataset/range as the ticks mark position, 
//use $(vector,format) to convert the dataset/range into space separated list.
dataset aa={1,4,9,17};
layer.x.ticksbydata$=$(aa);

range bb=[Book1]1!3 ; //Declared Book1 sheet1 column3 as a range
layer.y.ticksbydata$=$(bb);


This script specifies a column dataset to control the Tick Labels:

//Set the text column C in Book1 as the X axis tick labels
layer.x.labeltext$=book1_C;


This script will individually change the scale and color of third radar axis in Radar Chart counted from the default labeled radar axis for current active graph window:

layer.y3.from = 10;
layer.y3.color = color(red);