|
definition: |
plotResults :: (Show a, Show b) =>
String -> [PlotStyle] -> [(String,[(a,b)])] -> IO ()
plotResults outfile pstyles titleddata = do
let pname = dropExtension outfile
outsuffix = takeExtension outfile
plotfileprefix = pname ++ "_"
scriptfile = pname ++ ".gpscript"
terminalset = case outsuffix of
".pdf" -> "set terminal pdf enhanced"
".jpg" -> "set terminal jpeg nocrop enhanced"
_ -> error $ "plotResults: unsupported out file format: " ++ outsuffix
titleddatafiles <- mapM (writeDataFile plotfileprefix) (zip [1..] titleddata)
writeFile scriptfile $ unlines $
[terminalset
,"set output '" ++ outfile ++ "'"
,"set tics nomirror"
,"set style fill solid border"] ++
map plotStyle2GP pstyles ++
["plot " ++ intercalate " , " (map plotCmd titleddatafiles)]
system $ "gnuplot " ++ scriptfile
--system $ unwords (["rm",scriptfile] ++ map snd titleddatafiles)
putStrLn $ "Data plotted to '" ++ outfile ++ "'"
where
plotCmd (title,datfile) =
"\"" ++ datfile ++ "\" " ++
(if Histogram `elem` pstyles then "using 2:xtic(1) " else "") ++
(if null title then "notitle" else "title \"" ++ title ++ "\"")
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
Visualize a list of benchmarks results (i.e., lists of input/run-time pairs) as a plot graphic with gnuplot. Each benchmark result graph is provided with a title shown in the plot. The first argument is the plot name (i.e., the graphic will be stored in a JPEG file with suffix ".jpg" to this name). Further arguments are the plot style and the data to be plotted (represented as a pair of a title and the (x,y) values to be plotted). |
|
failfree: |
(_, _, _, _, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,_,_,_) |-> _}
|
|
name: |
plotResults |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
(Prelude.Show a, Prelude.Show b) => String -> [PlotStyle] -> [(String, [(a, b)])] -> Prelude.IO () |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |