DOT (.dot, .gv) Graph Format - Maple Programming Help

Home : Support : Online Help : Programming : Input and Output : File Formats : Formats/DOT

DOT (.dot, .gv) Graph Format

DOT file format

Description

 • DOT is a simple text-based file format for storing a single undirected or directed graph.
 • It also allows the application of attributes to nodes, edges and graphs.
 • The GraphTheory[ImportGraph] and GraphTheory[ExportGraph] commands can read from and write to this format.
 • The general-purpose commands Import and Export also support this format.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$

Import a DOT file encoding a directed graph.

 > $G≔\mathrm{Import}\left("example/digraph.dot",\mathrm{base}=\mathrm{datadir}\right)$
 ${G}{≔}{\mathrm{Graph 1: a directed unweighted graph with 11 vertices and 12 arc\left(s\right)}}$ (1)
 > $\mathrm{DrawGraph}\left(G,\mathrm{style}=\mathrm{spring}\right)$

Export the Desargues graph to a DOT file in the home directory of the current user.

 > $\mathrm{DG}≔\mathrm{GraphTheory}:-\mathrm{SpecialGraphs}:-\mathrm{DesarguesGraph}\left(\right)$
 ${\mathrm{DG}}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 20 vertices and 30 edge\left(s\right)}}$ (2)
 > $\mathrm{Export}\left("desargues.dot",\mathrm{DG},\mathrm{base}=\mathrm{homedir}\right)$
 ${370}$ (3)