-
Notifications
You must be signed in to change notification settings - Fork 0
02_Installation
This page guides you through installing fplot and its required
dependencies.
fplot is a high-level interface for gnuplot, so you must have
gnuplot installed on your system.
Using Homebrew:
brew install gnuplotsudo apt-get update
sudo apt-get install gnuplotsudo pacman -S gnuplotYou can download a gnuplot installer from the official gnuplot
website. After installation,
ensure that the gnuplot executable is in your system’s PATH.
To verify the installation, open a terminal and run:
gnuplot --versionYou should see the installed version of gnuplot.
You can use LuaRocks, (the package manager for
Lua modules), to install fplot, or you can git clone the github
repository.
luarocks install fplotYou can verify that fplot is installed correctly by running the
following code.
Create a file test.fnl:
(local fplot (require :fplot))
(print "fplot loaded successfully!")
(fplot.plot
{:options {:title "Test Plot"}
:datasets [{:data [1 2 3 4]}]})Run it from your terminal:
fennel test.fnlA plot window should appear with a simple line graph.
Create a file test.lua:
local fennel = require("fennel") fennel.install()
local fplot = require("fplot")
print("fplot loaded successfully!")
fplot.plot({
options = { title = "Test Plot" },
datasets = {
{ data = {1, 2, 3, 4} }
}
})Run it from your terminal:
lua test.luaA plot window should appear, just like the Fennel example.
If the plot window appears, you have successfully installed and
configured fplot!