It’s Not What You Draw,It’s What You Don’t Draw

The R graphics engine has new support for drawing complex paths via the functions polypath() and grid.path(). This article explains what is meant by a complex path and demonstrates the usefulness of complex paths in drawing non-trivial shapes, logos, customised data symbols, and maps. One of the design goals of the R graphics system is to allow fine control over the small details of plots. One way that the R graphics system does this is by providing access to low-level generic graphics facilities, such as the ability to draw basic shapes and the ability to control apparently esoteric, but still useful, features of those shapes, such as the line end style used for drawing lines. In R version 2.12.0, another low-level graphics facility was added to R: the ability to draw complex paths (not just polygons). This article describes this new facility and presents some examples that show how complex paths might be useful.

Paul Murrell

CRAN packages used

grImport, maptools, maps

CRAN Task Views implied by cited packages



Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".


For attribution, please cite this work as

Murrell, "The R Journal: It's Not What You Draw,It's What You Don't Draw", The R Journal, 2012

BibTeX citation

  author = {Murrell, Paul},
  title = {The R Journal: It's Not What You Draw,It's What You Don't Draw},
  journal = {The R Journal},
  year = {2012},
  note = {},
  doi = {10.32614/RJ-2012-017},
  volume = {4},
  issue = {2},
  issn = {2073-4859},
  pages = {13-18}