Generate a MetaPost file from a MetaPost path.
metapost(x, file = "fig.mp", digits=2)
A MetaPost path, as produced from knot etc.
knot
The name of the file to produce. If NULL, no file is created.
NULL
The number of decimal places to use when writing floating point values in MetaPost code.
The MetaPost code is returned invisibly.
# NOT RUN { p <- knot(0, 0) + dir(0) + dir(0) + knot(1, 1) mpcode <- metapost(p, NULL) mpcode # }
Run the code above in your browser using DataCamp Workspace