SetDrawXAxis
Prev | PHPlot Function Reference | Next

## SetDrawXAxis

SetDrawXAxis — Enable or disable drawing of the X axis line

## Synopsis

    $plot->SetDrawXAxis($draw)

## Description

`SetDrawXAxis` enables or disables drawing of the X axis line. Disabling the X axis line should be necessary only in special applications.

## Parameters

`$draw`

  True to draw the X axis line, False to not draw the X axis line.

## Notes

By default, the X axis line is drawn.

Disabling the X axis line does not disable associated plot elements, nor change the plot margin calculation. To produce a completely 'bare' plot, you must turn off the grid, tick marks, tick labels, and data labels. You also need to turn off the plot area border, which defaults to left and right sides. Lastly, you might want to reduce the margins, since the default minimum margin is 15 pixels on each side of the plot area, even if there are no axis lines, labels, or titles. Here is an example:

    // 'Bare' plot partial code example
    $plot->SetXTickPos('none');          // Turn off X tick marks
    $plot->SetXTickLabelPos('none');     // Turn off X tick labels
    $plot->SetXDataLabelPos('none');     // Turn off X data labels
    $plot->SetYTickPos('none');          // Turn off Y tick marks
    $plot->SetYTickLabelPos('none');     // Turn off Y tick labels
    $plot->SetPlotBorderType('none');    // Turn off plot area border
    $plot->SetDrawXGrid(False);          // Turn off X grid lines
    $plot->SetDrawYGrid(False);          // Turn off Y grid lines
    $plot->SetDrawXAxis(False);          // Don't draw X axis line
    $plot->SetDrawYAxis(False);          // Don't draw Y axis line
    $plot->SetMarginsPixels(2, 2, 2, 2); // Reduce plot margins to 2 pixels

See Section 5.24, “Example - Using Truecolor To Make a Histogram” for an example of a plot where axis lines are not desired. (The configuration data as shown in the example draws a full plot area border, so the axis lines would be covered anyway. But if the border is turned off, the axis lines would be visible unless they are suppressed as shown.)

## History

This function was added in PHPlot-5.3.0.

Prev | Up | Next
SetDrawPlotAreaBackground | Home | SetDrawXDataLabelLines