-
Notifications
You must be signed in to change notification settings - Fork 0
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 gnuplot
sudo apt-get update
sudo apt-get install gnuplot
sudo pacman -S gnuplot
You 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 --version
You 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 fplot
You 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.fnl
A 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.lua
A plot window should appear, just like the Fennel example.
If the plot window appears, you have successfully installed and configured fplot!