예제 #1
0
<?php

# $Id$
# PHPlot test: Truecolor linepoints, looking at point shapes
require_once 'phplot.php';
# Array of all point shapes as of PHPlot-5.1.0:
$point_shapes = array('halfline', 'line', 'plus', 'cross', 'rect', 'circle', 'dot', 'diamond', 'triangle', 'trianglemid', 'delta', 'yield', 'star', 'hourglass', 'bowtie', 'target', 'box', 'home', 'up', 'down');
$n = count($point_shapes);
$data = array();
for ($x = 0; $x < 4; $x++) {
    $row = array('', $x);
    for ($i = 0; $i < $n; $i++) {
        $row[] = ($i + 1) / 3 * $x;
    }
    $data[] = $row;
}
$p = new PHPlot_truecolor(1000, 800);
$p->SetTitle("Truecolor linespoint plot with all point shapes");
$p->SetDataType('data-data');
$p->SetDataValues($data);
# Reload data colors and apply alpha to all:
$p->SetDataColors(NULL, NULL, 60);
$p->SetLineWidths(3);
$p->SetLineStyles('solid');
$p->SetPointSizes(16);
$p->SetPointShapes($point_shapes);
$p->SetPlotType('linepoints');
$p->DrawGraph();
예제 #2
0
<?php

# $Id$
# PHPlot test: Truecolor points plot, big overlapped dots
require_once 'phplot.php';
mt_srand(0);
$data = array();
for ($i = 0; $i < 20; $i++) {
    $row = array('', $i);
    for ($j = 0; $j < 30; $j++) {
        $row[] = mt_rand(0, 100) / 10.0;
    }
    $data[] = $row;
}
$p = new PHPlot_truecolor(800, 600);
$p->SetTitle('Truecolor Points plot with varying size poionts');
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetDataColors(NULL, NULL, 90);
$p->SetLineWidths(3);
$p->SetLineStyles('solid');
$p->SetPointShapes('dot');
$p->SetPointSizes(array(10, 15, 20, 25, 30));
$p->SetPlotType('points');
$p->SetXTickIncrement(1);
$p->SetYTickIncrement(1);
$p->DrawGraph();