stitch_lettering: Add backstitch lettering into a ggplot2 object.

Description Usage Arguments Value Examples

View source: R/backstitch.R

Description

Add backstitch lettering into a ggplot2 object.

Usage

1
stitch_lettering(p, x, anchor = c(0, 0), scale = 1, set = "simple")

Arguments

p

The ggplot2 plot to use.

x

A character vector with the phrase to add to the plot.

anchor

The bottom-left position of the phrase in the plot.

scale

Scale of the lettering. I recommend you use integer values to make stitching easier! Default is 1.

set

Backstitch set to use. Default is "simple". Use names(backstitch_segments) to see all available.

Value

A ggplot2 plot object with an added geom_segment() layer.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(ggplot2)
library(dplyr)

p <- ggplot() +
  geom_point(data = iris,
             aes(x = Sepal.Length,
                 y = Petal.Length,
                 color = Species))

p %>%
  stitch_lettering("Nice 150 irises!",
                   anchor = c(4,6),
                   scale = 0.1,
                   set = "simple")

hypercompetent/xstitch documentation built on July 22, 2019, 10:11 p.m.