2013-05-28 136 views
16

使用gnuplot模塊,在繪製圖形之後,我將其放入gnuplot控制檯。有沒有辦法阻止這種情況發生?我從來沒有使用它,並且在關閉每個圖之後必須鍵入exit,尤其是當我測試一系列圖時,這很煩人。不要輸入gnuplot終端

例如:

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

我使用Windows 7 x64和Haskell的平臺2013.2.0.0如果有差別。

+1

你可以發佈你正在運行的代碼的最小例子嗎? – andyras

+0

@andyras添加到問題。 –

+0

也看看easyplot包:http://hackage.haskell.org/package/easyplot,這是另一個接口gnuplot – scravy

回答

1

嘗試以下操作:

bind Close "exit gnuplot" 

它應該做的伎倆!

看到這裏的綁定細節,如果你不熟悉:bind reference

0

我發現改變哈斯克爾的Gnuplot庫運行「pgnuplot」而不是「gnuplot的」(和重新安裝),它的作品,因爲它應該。