metapost-package: R Interface to MetaPost

Description Details Author(s) References See Also Examples

Description

Provides an R interface to METAPOST. There are functions to generate an R description of a MetaPost curve, functions to generate MetaPost code from an R description, functions to process MetaPost code, and functions to read solved MetaPost paths back into R.

Details

Generate a MetaPost path with functions like knot.

Write the MetaPost path to a file with metapost.

Run mpost on the file with mpost.

Read the solved path (Bezier control points) into R with mptrace.

Draw a solved path with grid.metapost.

It is also possible to pass grid.metapost the original path (and it will perform the write/solve/read steps itself).

Author(s)

Paul Murrell <paul@stat.auckland.ac.nz>

References

Hobby, J. D. and the MetaPost development team (2018). METAPOST a user's manual. https://www.tug.org/docs/metapost/mpman.pdf

See Also

knot metapost mpost mptrace grid.metapost

Examples

1
2
3
4
oldunits <- options(metapost.units="in")
p <- knot(0, 0) + dir(0) + dir(0) + knot(1, 1)
grid.metapost(p)
options(oldunits)

pmur002/metapost documentation built on May 9, 2020, 2:56 a.m.