<?php include '../GnuPlot.php'; use Gregwar\GnuPlot\GnuPlot; $plot = new GnuPlot(); header('Content-type: image/png'); echo $plot->setGraphTitle('Demo graph')->setXLabel('Something')->setYLabel('Another something')->setWidth(500)->setHeight(300)->push(0, 1)->push(1, 10)->push(2, 3)->push(3, 2.6)->push(4, 5.3)->setTitle(0, 'Demo')->get();
<?php include '../GnuPlot.php'; use Gregwar\GnuPlot\GnuPlot; $plot = new GnuPlot(); $plot->setGraphTitle('Demo graph')->setXLabel('Something')->setYLabel('Another something')->setUnit(GnuPlot::UNIT_INCH)->setWidth(11.02)->setHeight(8.27)->setTitle(0, 'Demo')->push(0, 1)->push(1, 10)->push(2, 3)->push(3, 2.6)->push(4, 5.3)->setTitle(1, 'Other curve')->push(0, 3.9, 1)->push(1, 2.3, 1)->push(2, 4.3, 1)->push(3, 3.1, 1)->push(4, 5.2, 1)->addLabel(2, 4.3, 'An important point')->writeEPS('out.eps');
<?php include '../GnuPlot.php'; use Gregwar\GnuPlot\GnuPlot; $alpha = 0; $plot = new GnuPlot(); while (true) { usleep(50000); $plot->reset(); $plot->setGraphTitle('The magic sinuses'); $plot->setTitle(0, 'The moving sinus'); $plot->setTitle(1, 'The moving cosinus'); for ($x = 0; $x < 10; $x += 0.01) { $plot->push($x, sin($alpha + $x)); $plot->push($x, cos($alpha * 1.5 + $x), 1); } $alpha += 0.1; $plot->refresh(); } sleep(1000);
<?php include '../GnuPlot.php'; use Gregwar\GnuPlot\GnuPlot; $plot = new GnuPlot(); $plot->setGraphTitle('Demo graph')->setXLabel('Something')->setYLabel('Another something')->setWidth(500)->setHeight(300)->setTitle(0, 'Demo')->push(0, 1)->push(1, 10)->push(2, 3)->push(3, 2.6)->push(4, 5.3)->setTitle(1, 'Other curve')->push(0, 3.9, 1)->push(1, 2.3, 1)->push(2, 4.3, 1)->push(3, 3.1, 1)->push(4, 5.2, 1)->addLabel(2, 4.3, 'An important point')->writePng('out.png');