5.16. Example - Thin Bar Line Plot
Prev | Chapter 5. PHPlot Examples | Next

## 5.16. Example - Thin Bar Line Plot

This is a Thin Bar Line Plot (thinbarline).

Example 5.16. Thin Bar Line

    <?php
    # PHPlot Example: thinbarline plot
    require_once 'phplot.php';

    # To get repeatable results with 'random' data:
    mt_srand(1);

    # 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->SetImageBorderType('plain');

    $plot->SetPlotType('thinbarline');
    $plot->SetDataType('text-data');
    $plot->SetDataValues($data);

    # Main plot title:
    $plot->SetTitle('Noisy Data (thinbarline)');

    $plot->DrawGraph();

Prev | Up | Next
5.15. Example - Stacked Bars, Unshaded | Home | 5.17. Example - Thin Bar Line Plot, Wider Lines