|Did you know ...||Search Documentation:|
|Pack plplot -- README.md|
Plot graphs using prolog and gnuplot.
gnuplot must be installed and in the path.
To check if gnuplot is installed type: `command -v gnuplot`. If nothing is printed, this means that gnuplot is missing.
You can download it from http://www.gnuplot.info/download.html and then follow the instructions in the folder.
Usually you need other libraries to install gnuplot as
plplot can be installed using pack_install/1
$ swipl ?- pack_install(plplot).
Still does not work on Windows
plot_point('Title',[1.0, 2.0, 3.0, 4.0, 5.0],[5.0 ,3.0, 1.0, 3.0, 5.0]).
The result should be something like: !Screenshot
It's simple: the commands are saved in a file named
The data are saved in a file named
Then gnuplot is called passing those two files.
To use the program without downloading the package with pack_install/1 you can do:
:- load_foreign_library(plplot). test_p:- plot_point('Title',[1.0, 2.0, 3.0, 4.0, 5.0],[5.0 ,3.0, 1.0, 3.0, 5.0]).
$ swipl test.pl ?- test_p.
Pull requests, issues or whatever you prefer.