summaryrefslogtreecommitdiff
path: root/lib/Graphics
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2009-06-17 20:52:14 +0000
committerAlberto Ruiz <aruiz@um.es>2009-06-17 20:52:14 +0000
commit5db2ed78986bbc737b82e428392ee63999c8abfd (patch)
tree45d95942c831c25a5adbc88e8b266fac0c6ce87e /lib/Graphics
parente58f1e0e94407983fa18cd535cf76427019f1519 (diff)
vector fread/fwrite, fscanf/fprinf
Diffstat (limited to 'lib/Graphics')
-rw-r--r--lib/Graphics/Plot.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Graphics/Plot.hs b/lib/Graphics/Plot.hs
index 9b64a1d..e6a9098 100644
--- a/lib/Graphics/Plot.hs
+++ b/lib/Graphics/Plot.hs
@@ -40,8 +40,8 @@ size = dim
40--fromFile filename = readFile filename >>= return . readMatrix read 40--fromFile filename = readFile filename >>= return . readMatrix read
41 41
42-- | Saves a real matrix to a formatted ascii text file 42-- | Saves a real matrix to a formatted ascii text file
43toFile :: FilePath -> Matrix Double -> IO () 43toFile' :: FilePath -> Matrix Double -> IO ()
44toFile filename matrix = writeFile filename (unlines . map unwords. map (map show) . toLists $ matrix) 44toFile' filename matrix = writeFile filename (unlines . map unwords. map (map show) . toLists $ matrix)
45 45
46------------------------------------------------------------------------ 46------------------------------------------------------------------------
47 47
@@ -74,7 +74,7 @@ mesh m = gnuplotX (command++dat) where
74mesh' :: Matrix Double -> IO () 74mesh' :: Matrix Double -> IO ()
75mesh' m = do 75mesh' m = do
76 writeFile "splot-gnu-command" "splot \"splot-tmp.txt\" matrix with lines; pause -1"; 76 writeFile "splot-gnu-command" "splot \"splot-tmp.txt\" matrix with lines; pause -1";
77 toFile "splot-tmp.txt" m 77 toFile' "splot-tmp.txt" m
78 putStr "Press [Return] to close the graphic and continue... " 78 putStr "Press [Return] to close the graphic and continue... "
79 system "gnuplot -persist splot-gnu-command" 79 system "gnuplot -persist splot-gnu-command"
80 system "rm splot-tmp.txt splot-gnu-command" 80 system "rm splot-tmp.txt splot-gnu-command"