Contact & Privacy

openPlaG - Plot-a-Graph - Download

openPlaG3_3.tar.gz  3.307/01/201746.8 kB10th anniversary version: new feature Circle at origin, new root function rt, some bug fixes and improvements.

Show older versions | Hide older versions

The source code has more functions included than the online version function graph plotter. This is, because some extremely computational intensive functions (gamma, zeta, theta) and those which use these had to be removed from the online version, because of server overload. Keep this in mind when keeping them in the source code.


Here is the source code of the Online Function Graph Plotter, published as open source (or free software, whatever term you prefer) under the GNU GPL v2. Use and change it as you wish, according to the license. I cannot give any free for setup or code, but the source code should be quite understandable for anyone familiar with PHP. However, if you make any improvements, fix bugs or add new functions, please mail them to me, juergen [at] jumk [dot] de.

About the program

openPlaG is an online function graph plotter, written in PHP, tested on PHP 5.3. It can compute and plot a very high amount of functions, including many probability functions and is fairly good configurable. It has an extensive instruction page. Click one of the links above to see it in action.


To run the program, you'll need access to a web server with PHP 5 and GDlib running. From 2.0 on, it should work with register_globals = OFF in the php.ini, too, although I haven't tried. If you do so, please tell me.
With PHP 4.4.1 the 1.x series worked well. However, 2.x and 3.x have some functions which require PHP 5, like imagefilter(). If you want to stick with PHP 4, remove these functions, but I recommend switching to PHP 5.

The downloaded program is a zipped tarball, which contains these files:
back.png background image for transparency, new in version 2.2. differential and integral functions, new in version 3.0.
function.php the iframe content, where the graph image is shown.
gnu_gpl.txt GNU GENERAL PUBLIC LICENSE Version 2. Read it, don't change it.
graph.css the style sheet.
graph.php calculates the graph and draws the image. You should uncomment the line at the beginning (the one with the $HTTP_REFERER) and enter your own URL there.
init.php security check and formulae (functions) definitions.
instructions.html explains the use of the plotter.
openPlaG.html start here when getting into the source code. This is the start page with the two iframes for the graph and the single values. You may want to change its name to index.html or something like that, but then don't forget to change the links in the instruction, too.
script.js from version 2.4 on, the javascript functions have moved into this file to increase clearness.
single.php calculates a formula with single values, not the whole graph. The result is shown in the second iframe. From version 2.2 on, multiple values can be calculated at once, the output is a score table.

Upload the files on your server. The program should work without problems, if server and PHP are configured properly. Make your changes as you want to, but don't forget to tell me if you make something really amazing or useful ;-) Have fun :-) Juergen Kummer

© Webprojects | Imprint & Privacy

Sample graph: condition on sinc, sine cardinalis (sinc), vertical asymptote at π
Different scales for x and y. No reticule lines, no caption, gap at origin.
Sine cardinalis


03/13/2017 Yep, still alive.

11/17/2008 In the beginning of 2009 a version 3.0 will appear. I am planning to release less often from now on, but to take more care on testing and debugging. 3.0 will have some changes, but probably no major ones. The jump from 2 to 3 is due to the longer release cycles (and the new year ;).

09/21/2008 In version 2.5 is a bug: numbers like 2E10 or 3E-5 are interpreted wrong. This will be fixed in version 2.6 [done]. To fix it manually, change in the init.php line 183 to
if(ereg("[a-zA-Z]",substr($term,$i+1,1)) && substr($term,$i+1,1)!="E") {

02/11/2008 Many thanks to Matthias Bilger, who programmed the ^ to pow() conversion (new in 2.1, see init.php), thus giving the program its first piece of oop.

01/29/2008 One bug (no, it's not a feature!) in 2.0: When drawing an asymptote, an error message will occur. To avoid that, disable errors. This will be fixed in the next version [done].

01/08/2008 If you want a German translation of the plotter, you can use that from the Funktionsgraphen-Plotter. If you want other languages, you have to translate yourself.

09/16/2007 A minor mistake in version 1.03: the instructions say, that constants like pi/2 and pi*2 in the display adjustment are allowed, too. That is no longer true from 1.03 on, only constants like pi are still allowed. This is due to security reasons, because these values will be executed via eval().

09/06/2007 I have no idea why the tar.gz-file of version 1.02 is smaller than that of version 1.01. The included files of 1.02 indeed are a bit larger than those of its predecessor.

09/06/2007 The error function erf, new in version 1.02, uses the Taylor series, which contains an infinite sum. I decided that it's enough to count to 100 for a satisfying preciseness. Change that if you like, but higher values result in a higher computing time.

08/29/2007 What I forgot to mention before: the heart of the program, i.e. the part that does the calculation, is the last block in the init.php.

07/20/2007 The 'Load & Save' section, new in version 1.01, will only work, if openPlaG.html and function.php are running on the same domain. This shouldn't be a major handicap. However on my page, Function Graph Plotter, this is not the case and this feature is therefore not included there. If you have the same problem, remove that feature. Update: Working now on my page too, since I moved to another server with 2.0.

07/04/2007 Depending on the used functions, the program can be computationally very intensive, especially when doing these things that need the gamma function (which is already defused) or the Riemann zeta function. This is the main reason why the image has a max width of only 500 pixels. Change that to larger images, if you think your server can handle it. The same is true for the amount of graphs - the more graphs the more intensive, so I restricted them to three. Other restrictions, like the number of available colors, are due to usability and simplicity, on which the program aims. Change that at will.

Something completely different

I hope you like that one, too: Images of the chemical elements from the periodic table