Wednesday 12 June 2013

Setup Haskell Plotting

I explored the space of Haskell Plotting quite extensively. It is dense, plotting is detailed. None of the examples are simple.

chart-gtk

This has extensive tests. I found the examples and tests pretty complex in themselves. This is probably the right place to dig deeper, but for now I have a limited set of goals in mind.


sudo apt-get install libgtk2.0-dev 
sudo apt-get install libpango1.0-dev 
sudo apt-get install libglib2.0-dev 
sudo apt-get install libcairo2-dev

sudo apt-get install  alex
sudo apt-get install  happy

sudo apt-get install gtk2hs-buildtools
cabal install chart-gtk

easyplot

The clue is in the name: easyplot is not. I could get the complex example to work, but I could not understand or modify it. Some nasty asymmetry in types meant I could not adapt this to my simple use case.


sudo apt-get install gnuplot-x11
cabal install easyplot

plot

At last someone with a clue has posted a little thing that works!


cabal install cabal
cabal install gtk2hs-buildtools
sudo apt-get install libcairo-dev
sudo apt-get install liblapack-dev
sudo apt-get install libgsl0-dev
cabal install hmatrix
cabal install hmatrix-gsl-stats
cabal install plot

The simple example works and can be extended:


timp@eric17:~$ ghci 
GHCi, version 7.6.2: http://www.haskell.org/ghc/  :? for help
Prelude> import Graphics.Gnuplot.Simple
Prelude Graphics.Gnuplot.Simple> plotList [] [(2,10),(3,15),(4,14),(5,19)]

timp@eric17:~$ ghci 
GHCi, version 7.6.2: http://www.haskell.org/ghc/  :? for help
Prelude> import Graphics.Gnuplot.Simple
Prelude Graphics.Gnuplot.Simple> plotList [] [(2,10),(3,15),(4,14),(5,19)]

No comments:

Post a Comment