5.13. Example - Squared Plot

This is a squared line plot, which is similar to a line plot but the points are connected with steps.

Example 5.13. Squared Plot

Squared Plot Example
# PHPlot Example: squared plot
require_once 'phplot.php';

# To get repeatable results with 'random' data:

# Make some noisy data:
$data = array();
for ($i = 0; $i < 100; $i++)
  $data[] = array('', $i / 4.0 + 2.0 + mt_rand(-20, 20) / 10.0);

$plot = new PHPlot(800, 600);


$plot->SetTitle('Noisy Data (squared plot)');

# Make the lines a bit wider:

# Turn on the X grid (Y grid is on by default):

# Use exactly this data range:
$plot->SetPlotAreaWorld(0, 0, 100, 40);


SourceForge.net 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.