SetXTickAnchor — Set an anchor point for X tick marks
$plot->SetXTickAnchor([$xta
])
SetXTickAnchor
sets an anchor point for X tick marks.
This ensures that a tick mark will be placed at that value (if it is within
the plotted data range). The effect of this function is to slide the set
of tick marks along the axis until one of them falls on the anchor. This
also affects the position of the tick labels and X grid lines. It does not
change the plotted data values, nor the range of values along the X axis.
$xta
The desired X anchor point, in world coordinates. If omitted or NULL, the default of not using an anchor is restored.
By default, there is no anchor point for X tick marks. PHPlot will generally place the left-most tick mark at the left of the X axis range. For example, if the X range is -5 to 5, and the tick increment is 2, tick marks will be placed at X=-5, -3, -1, 1, 3, and 5. Note there is no tick mark at the Y axis position X=0.
If an X tick anchor is set, and its value is within the plotted range, PHPlot will adjust the left-most tick mark so that there is a tick mark at the X tick anchor position. For example, if the X range is -5 to 5, the tick increment is 2, and the X tick anchor is set to 0, ticks marks will be placed at X=-4, -2, 0, 2, and 4.
The X tick anchor need not be within the plotted range. If the tick anchor is outside the plotted range, the tick marks will still be adjusted so that a tick marked would be placed at the anchor if the data range was extended to include it. For example, if the X range is -5 to 5, the tick increment is 2, and the X tick anchor is set to 10, ticks marks will still be placed at X=-4, -2, 0, 2, and 4 as in the previous example.
See Section 5.38, “Example - Hourly Data Using X Tick Anchor” for an example of setting an X tick anchor.