SetDrawXAxis — Enable or disable drawing of the X axis line
$plot->SetDrawXAxis($draw
)
SetDrawXAxis
enables or disables drawing of the X axis
line. Disabling the X axis line should be necessary only in special
applications.
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.)
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.