5.48. Example - Horizontal Linepoints Plot with Data Value Labels and Lines

This is a horizontal 'linepoints' plot. In a horizontal plot, the Y (vertical) axis is for the independent values, and the X axis (horizontal) is for the dependent values, so PHPlot is graphing X = F(Y).

This plot has:

Note: Horizontal linepoints plots were added in PHPlot-6.0.0.

Example 5.48. Horizontal Linepoints Plot with Data Value Labels and Lines

Horizontal Linepoints Plot with Data Value Labels and Lines Example
<?php
# PHPlot Example - Horizontal linepoints plot with Y Data Label Lines
require_once 'phplot.php';

$data = array(
            array("SEA\nLEVEL", 0, ''),
            array('100m', 1, 10),
            array('200m', 2, 22),
            array('300m', 3, 30),
            array('400m', 4, 46),
            array('500m', 5, 53),
            array('600m', 6, 65),
            array('700m', 7, 70),
            array('800m', 8, 50),
            array('900m', 9, 35),
        );

$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain'); // Improves presentation in the manual
$plot->SetTitle('Wind Speed at Altitude');
$plot->SetDataType('data-data-yx');
$plot->SetDataValues($data);
$plot->SetPlotType('linepoints');
$plot->SetPlotAreaWorld(0, 0, 100, 10);
$plot->SetDrawYDataLabelLines(True);
$plot->SetXTitle('Wind Speed');
$plot->SetYTitle('Altitude');
$plot->SetYTickLabelPos('none');
$plot->SetYTickPos('none');
$plot->SetXDataLabelPos('plotin');
$plot->SetDrawXGrid(False);
$plot->SetDrawYGrid(False);
$plot->DrawGraph();

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.