16
votes

Using the gnuplot module, after I plot a graph I get put into the gnuplot console. Is there a way to stop this happening? I never use it, and it's annoying to have to type exit after closing each graph, especially when I'm testing a sequence of plots.

For example:

module Main where
import Graphics.Gnuplot.Simple
main = do
    let xs = linearScale 100 (-10, 10) :: [Float]
    plotFunc [] xs sin
    plotFunc [] xs cos

I'm using Windows 7 x64 and the Haskell Platform 2013.2.0.0 if that makes a difference.

1
Can you post a minimal example of the code you are running? - andyras
@andyras Added to question. - Daniel Buckmaster
Also have a look at the easyplot package: hackage.haskell.org/package/easyplot , which is another interface to gnuplot - scravy
@scravy Thanks, I'll see if that fits my needs. - Daniel Buckmaster
@scravy Maybe it's a Windows issue - with easyplot, calling plot Windows sin creates a plot window which immediately closes. Calling plot' [Interactive] Windows sin opens the gnuplot console like before. I'll give it a go on a Mac when I get access to one with the platform installed. - Daniel Buckmaster

1 Answers

1
votes

Try the following:

bind Close "exit gnuplot"

It should do the trick!

See here for bind details if you aren't familiar: bind reference