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 libwxgtk3.0-dev
libpango1.0-dev
and libreadline5-dev
.
plplot can be installed using pack_install/1
$ swipl ?- pack_install(plplot).
Still does not work on Windows
$ swipl
?- use_module(library(plplot))
.
?- 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 commands.txt
.
The data are saved in a file named data.temp
.
Then gnuplot is called passing those two files.
To use the program without downloading the package with pack_install/1 you can do:
or
/usr/lib/swi-prolog/include/`.test.pl
like this:
:- 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.