Chapter 3. PHPlot Concepts

This chapter explains the operation and use of PHPlot. For advanced topics, see Chapter 4, PHPlot Advanced Topics.

3.1. Definitions

This section contains definitions of terms used throughout the PHPlot Reference Manual.

Alpha value

A component in a color system which represents the amount of transparency, or opacity. At one extreme, an alpha value indicates an opaque object which covers or hides whatever was drawn before it. At the other extreme, it indicates a completely transparent object which has no affect on whatever was drawn before it.

Data Set

A set of data points which represent some function, trend, samples, etc.

Device Coordinates

The coordinate space used by GD to create images. The origin is at the upper left corner, X increases to the right, Y increases down, and the units are pixels. Also known as Pixel Coordinates or GD Coordinates.


A component of a graph, such as a label, tick mark, axis, or plot.


A programming library used to create and manipulate images. GD can be found at the GD Graphics Library home page, but is also included with PHP releases. You can think of GD as a software implementation of a video card. GD is also available via a PHP extension, and that is what PHPlot uses to create images.


A complete, labeled, graphical representation of some data sets. In PHPlot, a graph contains a single plot and other elements such as axes, tick marks, and labels.

Horizontal Plot

A plot in which the Y (vertical) axis represents the independent variable, and the X (horizontal) axis represents the dependent variable values. In a horizontal bar chart, for example, the bars extend to the right from the Y axis. A horizontal plot might represent X = F(Y), for example. (Note: This usage is specific to PHPlot. An alternate approach, not used by PHPlot, is to swap the X and Y axis orientation to make horizontal plots.)


A graphical image, represented as data. For example, a PNG file is an image in PNG format which is stored in a file. PHPlot creates images using the GD library. A PHPlot image contains one or more graphs (but usually only one).

Palette Image

A color image file, or image in memory, in which each pixel value is an index into a color map which contains the actual color. Typically, the pixel value is 8 bits, limiting this type of image to 256 distinct colors. See also Truecolor Image.


The graphical representation of one or more data sets. In PHPlot, each graph contains a single plot, but a plot can contain representation of multiple data sets (for example, you can have 3 line charts on a plot).

Less formally, the term 'plot' is often used for the overall output of PHPlot: an image with a complete graphical representation of data, with labels, legend, title, etc.

Relative Coordinates

A coordinate space in which the X and Y coordinates represent a fraction of the size of an object. The point (0,0) is defined as the upper left corner of the object, and (1,1) is the lower right corner. (Relative coordinate values are not restricted to the range 0 to 1, however.) So a point specification in relative coordinates to an object is independent of the size of the object. This coordinate system is used by SetLegendPosition.

Truecolor Image

A color image file, or image in memory, in which each pixel value has a complete representation of the color of that pixel. The pixels may use 24 bits, with 8 bits each for red, blue, and green color components, or 32 bits with an additional alpha component. See also Palette Image.

Vertical Plot

A plot in which the X axis represents the independent variable, and the Y axis represents the dependent variable values. This is the usual orientation for plots, and might represent Y = F(X). Compare with horizontal plot.

World Coordinates

The coordinate space of the plotted data. This is the real world coordinate space, in the units of whatever the plotted data measures. The origin of the world coordinate space is the 0,0 point on the X and Y axes. The X coordinate increases to the right, and the Y coordinate increases upwards. Note that the Y direction of world coordinates is opposite that of device coordinates. (World coordinates are only defined for plots in an orthogonal X/Y coordinate space, so there are no world coordinates for pie charts.) Logo

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.