[ library(graphviz) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]
write_graph(+Graph, +File, +Format, +Options)
Write a picture of a graph as a file of a given format
- Graph
- A graph structure
- File
- A file name
- Format
- An atom (ps,dot,png,gif,...)
- Options
- A list of Option:Value pairs
Description
This predicate takes a graph, applies one of the graphviz layout routines
to it, and writes the result to a file is a given format.
Possible options are as specified in view_graph/2.
Some possible formats are: ps, dot, png, gif, ... See the graphviz
documentation for details.
Examples
?- lib(graph_algorithms), lib(graphviz).
Yes (1.17s cpu)
?- make_random_graph(10,30,true,true,true,G),
write_graph(G, "mygraph", png).
G = graph(...)
Yes (0.03s cpu)
?- make_random_graph(10,30,true,true,true,G),
write_graph(G, "mygraph", dot).
G = graph(...)
Yes (0.03s cpu)
See Also
write_graph / 2, write_graph / 3, view_graph / 2, library(graph_algorithms)