I’m using the Haskell platform on Windows and I’d like to write a small program which can draw graphs. The graph should be exported to any image format (or even PDF).
What is the easiest way to accomplish this?
(By graph I mean plot.)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By “graph”, do you mean the graph theory meaning of graph (nodes and edges) or a plot?
The easiest way to output a graph, in any language, is to pipe dot into Graphviz. Hackage even has a helpful Data.Graphviz package which does some of the low-level work for you, especially if you’re already working with the excellent FGL.
The easiest way to output a plot, in any language, is to pipe gnuplot script into gnuplot. Again, there’s a Graphics.Gnuplot package on Hackage.
Graphics.Rendering.Chart is quite nice; it does a fair amount more than gnuplot.
Actually, you should just look around Hackage and see what best suits your needs…