If a data point is outside the plot area, but inside the image area, it still gets drawn. PHPlot should clip the plotted data to the plot area.
Originally submitted by sf.net user dsta85 in this thread: http://sourceforge.net/projects/phplot/forums/forum/46382/topic/3303400
Discussion: Top (and right) margin is not honored by plot
Wiki: 6.0.0-README
Wiki: 6.1.0-README
Wiki: 6.2.0-README
A limitation in PHP/GD prevents fixing this. Although GD has the ability to specify a clipping box for drawing, the PHP GD extension does not make the functions available. A PHP feature request was opened to request this:
http://bugs.php.net/bug.php?id=52857
imagesetclip() and imagegetclip() are available in PHP 7.2.