SetPlotAreaWorld

SetPlotAreaWorld — Override automatic data scaling to device coordinates

Synopsis

$plot->SetPlotAreaWorld([$xmin], [$ymin], [$xmax], [$ymax])
    

Description

SetPlotAreaWorld changes the range for World Coordinate space. This is the coordinate space of the data to be plotted, and is translated and scaled to fit into the Device Coordinate space of the image. By default, PHPlot defines the world coordinate space by the actual limits of the data to be plotted. By using SetPlotAreaWorld, you can override one or more of these calculated limits. Each parameter you specify overrides the corresponding calculated limit. Each defaulted or NULL parameter is ignored and the calculated limit is used.

Since tick marks are automatically positioned based on the world coordinate limits, SetPlotAreaWorld is also used to force a specific range for tick marks.

Parameters

$xmin

Optional argument specifying the desired X data range minimum value. If omitted or NULL, the value is calculated from the actual plot data.

$ymin

Optional argument specifying the desired Y data range minimum value. If omitted or NULL, the value is calculated from the actual plot data.

$xmax

Optional argument specifying the desired X data range maximum value. If omitted or NULL, the value is calculated from the actual plot data.

$ymax

Optional argument specifying the desired Y data range maximum value. If omitted or NULL, the value is calculated from the actual plot data.

Notes

Because SetPlotAreaWorld needs to access and interpret the data array, it must be called after SetDataValues sets the data array, and after SetDataType (if used).

Trailing defaulted arguments can be omitted, but non-trailing defaulted arguments must be specified as NULL. For example, to set the minimum X value to 10, the maximum X value to 100, and default the Y scaling, you can use:

$plot->SetPlotAreaWorld(10, NULL, 100);
      

This will reset the scale factors if SetPlotAreaPixels was already called, so SetPlotAreaPixels and SetPlotAreaWorld can be called in either order.