TuneXAutoRange — Adjust tuning parameters for X axis range calculation


$plot->TuneXAutoRange([$zero_magnet], [$adjust_mode], [$adjust_amount])


TuneXAutoRange is used to adjust the parameters used by PHPlot when automatically calculating the plot range along the X axis.



Optional value for the X axis zero magnet, which controls how far PHPlot will extend the plot range to include 0 if it doesn't already include 0. This is a floating point value between 0 and 1 inclusive, where 0 disables the zero magnet, and 1 requires the range be always extended to include 0. See Section, “Range parameter: zero_magnet” for more information.


Optional value for the X axis range extension mode, which determines the method PHPlot uses to extend the end of the plot range beyond the data range. This is a single character:

T Tick : extend the range, then to the next tick mark.
R Range : extend the range.
I Integer : extend the range, then to the next integer value.

See Section, “Range parameter: adjust_mode” for more information.


Optional value for the X axis range extension amount. This is a factor of the overall range by which the range is extended to leave extra room for labels, plot markers, etc. See the Section, “Range parameter: adjust_amount” for more information.


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

PHPlot does not calculate or adjust ends of the plot range which are set with SetPlotAreaWorld. PHPlot also does not adjust the plot range for the X axis in the case where X values are implied, rather than specified, in the data array (data type text-data, used with vertical plots).

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 TuneYAutoRange.

See Section 4.6.3, “Automatic Range Calculation” for more information on the range calculations and parameters.

The default for the zero magnet is 6/7, which results in up to 600% range extension. The default adjustment mode is T, which forces the axis to end at a tick mark. The default adjustment amount is either 0% or 3% (0.03), depending on the plot type and whether X is the independent or dependent variable.


If you do not want PHPlot to extend your X axis to include zero, even if it is relatively close, set the zero magnet to 0 to disable it.



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.