I've been using the Glasgow Haskell Compiler (GHC) to learn Haskell. I installed the gnuplot package using Cabal (I used the command cabal install --lib gnuplot
). I can load the gnuplot module, however, when I try to use gnuplot, it doesn't display the function plot:
ghci> :m Graphics.Gnuplot.Simple
ghci> plotFunc [][1.0,1.01..10.0] sin
ghci> ghc-9.2.8.exe: gnuplot: readCreateProcessWithExitCode: does not exist (No such file or directory)
I've already tried uninstalling and reinstalling the package, which doesn't solve the problem. I think it might be linked to my computers Path and environment variables, but I don't know what to do.
Haskell's gnuplot library does not replicate the gnuplot
program. It basically is a wrapper that writes a gnuplot program and passes that to gnuplot.
But in order to plot, gnuplot thus has to do the actual work. You thus need to install gnuplot on your system. For example for a debian-like system, we an install gnuplot
with:
$ sudo apt-get install gnuplot