TuneXAutoTicks

TuneXAutoTicks — Adjust tuning parameters for X axis tick increment calculation

Synopsis

$plot->TuneXAutoTicks([$min_ticks], [$tick_mode], [$tick_inc_integer])

Description

TuneXAutoTicks is used to adjust the parameters used by PHPlot when automatically calculating the tick increment along the X axis.

Parameters

$min_ticks

Sets the minimum number of tick intervals along the X axis. This is an integer greater than zero. See Section 4.6.8.1, “Tick Increment parameter: min_ticks” for more information.

$tick_mode

Selects from one of three available modes for calculating the tick increment along the X axis:

ModeDescription
decimalUse a power of 10 times 1, 2, or 5
binaryUse a power of 2
dateUse a date/time value

See Section 4.6.8.2, “Tick Increment parameter: tick_mode” for more information.

$tick_inc_integer

If TRUE, forces PHPlot to pick a whole number (integer) tick increment. If FALSE, allows fractional tick increments. See the Section 4.6.8.3, “Tick Increment parameter: tick_inc_integer” for more information.

Notes

Specifying NULL, or omitting trailing unused parameters, results in no change to that parameter.

If the tick increment is set with SetXTickIncrement or indirectly with SetNumXTicks, then PHPlot does not need to calculate the tick increment, and the parameters set with TuneXAutoTicks are not used.

This applies to the X axis only, where X is the independent variable for vertical plots, and the dependent variable for horizontal plots. See also TuneYAutoTicks.

See Section 4.6.7, “Automatic Tick Increment Calculation” for more information on the tick increment calculations and parameters.

The default for min_ticks is 8. The maximum number of tick intervals is about 2.5 times the minimum number.

The default for tick_mode depends on the label formatting type along the X axis. If SetXLabelType('time') is used to select date/time formatting of labels, then the default for tick_mode is 'date', otherwise it is 'decimal'.

The default for tick_inc_integer is FALSE, meaning PHPlot may use fractional tick increments. (Note this does not mean a tick increment such as 2.5 would ever be selected. PHPlot uses whole numbers above 1 and fractional increments between 0 and 1.)

Example

Use a minimum of 10 tick intervals along the X axis, and do not allow tick increments less than 1:

$plot->TuneXAutoRange(10, NULL, TRUE);

History

This function was added in PHPlot-6.0.0.

SourceForge.net Logo

This version of the manual was produced for the PHPlot Sourceforge project web service site, which requires the logo on each page.

To download a logo-free copy of the manual, see the PHPlot project downloads area.