MetaPost Graph Format - Maple Programming Help

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

MetaPost Graph Format

MetaPost file format

Description

 • MetaPost is a graph file format based on the Metafont language.
 • The Export and GraphTheory[ExportGraph] commands can write to this format.

Examples

Export the Levi graph to a MetaPost file in the home directory of the current user.

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{levi}≔\mathrm{SpecialGraphs}:-\mathrm{LeviGraph}\left(\right)$
 ${\mathrm{levi}}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 30 vertices and 45 edge\left(s\right)}}$ (1)
 > $\mathrm{DrawGraph}\left(\mathrm{levi},\mathrm{style}=\mathrm{spring}\right)$
 > $\mathrm{file}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["levi.mp"\right],\mathrm{base}=\mathrm{homedir}\right)$
 ${"/Users/JohnSmith/levi.mp"}$ (2)
 > $\mathrm{ExportGraph}\left(\mathrm{levi},\mathrm{file},\mathrm{metapost}\right)$