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

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);

History

SetPlotAreaPixels and SetPlotAreaWorld can be called in either order. Through PHPlot-5.0.4 this was because SetPlotAreaWorld would reset the scale factors if SetPlotAreaPixels was already called. Starting with PHPlot-5.0.5, both functions just store the information, and no calculations take place until DrawGraph is used.

Through PHPlot-5.0.4, SetPlotAreaWorld needed to access and interpret the data array, so it had to be called after SetDataValues sets the data array, and after SetDataType (if used). Starting with PHPlot-5.0.5, this restriction no longer applies and the functions can be called in any order.