title->set('f(x) = x * x'); $graph->title->setBackgroundColor(new White(0)); $graph->title->setPadding(NULL, NULL, 10, 10); $graph->title->move(0, -10); $plot = new MathPlot(-3, 3, 10, -2); $plot->setInterval(0.2); $plot->setPadding(NULL, NULL, NULL, 20); // Defines x² function x2($x) { return $x * $x; } $function = new MathFunction('x2'); $function->setColor(new Orange); $plot->add($function); $graph->add($plot); $graph->draw(); ?>