SetYAxisPosition
Prev | PHPlot Function Reference | Next

## SetYAxisPosition

SetYAxisPosition — Move the Y axis

## Synopsis

    $plot->SetYAxisPosition($pos)

## Description

`SetYAxisPosition` sets the position of the Y axis.

## Parameters

`$pos`

  The X position in world coordinates for the Y axis. (World coordinates are the coordinate space of your data points.) If the value is omitted or an empty string, the default behavior is restored.

## Notes

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

The default axis position differs for vertical and horizontal plots. For vertical plots, the Y axis position defaults to the left side of the plot. For horizontal plots, the Y axis position defaults to X=0, provided X=0 is within the range of the graph. If X=0 is not within the range of the graph, the Y axis position will default to the edge with the smallest absolute X value. This means the Y axis will be on the left side of the graph if all values of X are greater than zero, and on the right side of the graph if all values of X are less than zero. (For log scale plots, however, the default Y axis position is X=1.)

## History

Through PHPlot-5.3.0, the argument was required, and there was no way to restore the default behavior (because the argument value was always converted to an integer). Starting with PHPlot-5.3.1, the argument may be given as an empty string, or omitted, to restore the default behavior.

Through PHPlot-5.1.3, there was no special handling for horizontal plots. The Y axis always defaulted to the left side of the plot. When plotting negative data with horizontal plots, it was usually necessary to use `SetYAxisPosition(0)` to force the bars to start from X=0.

Prev | Up | Next
SetXTitleColor | Home | SetYDataLabelAngle