SetXAxisPosition

SetXAxisPosition — Move the X axis

Synopsis

$plot->SetXAxisPosition($pos)
    

Description

SetXAxisPosition sets the position of the X axis, which is normally at Y=0.

Parameters

$pos

The Y position in world coordinates for the X axis. (World coordinates are the coordinate space of your data points.)

Notes

The given position is truncated (towards 0) to an integer value.

The default position for the X axis is Y=0, provided Y=0 is within the range of the graph. If Y=0 is not within the range of the graph, the X axis will default to the edge with the smallest absolute Y value. This means the X axis will be at the bottom of the graph if all values of Y are greater than zero, and at the top of the graph if all values of Y are less than zero. (For log scale plots, however, the default X axis position is Y=1.)

History

Through PHPlot-5.1.0, the default position for the X axis was the bottom of the graph whenever Y=0 was not within the range the graph, regardless of whether the data was all positive or all negative.