Learn R Programming

metapost (version 1.0-6)

metapost-package: R Interface to MetaPost

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.

Arguments

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).

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

Run this code
# NOT RUN {
oldunits <- options(metapost.units="in")
p <- knot(0, 0) + dir(0) + dir(0) + knot(1, 1)
grid.metapost(p)
options(oldunits)
# }

Run the code above in your browser using DataLab