hand_legend: Sketchy legend with 'handwritten' font

Description Usage Arguments Value Examples

Description

Similar to the legend command, but chooses a hand writing styled font, and draws sketchy legend symbols

Usage

1
2
hand_legend <- function(labels,tlx,tly,side,gap,cex=1,fontfam='am',...)
labels %>% hand_legend(...)

Arguments

labels

a character string array of legends labels

tlx

top left x coordinate of legend

tly

top left y coordinate of legend

side

length of size of square in legend

gap

gap between bottom of one legend and top of next

cex

scale of legend text

fontfam

Handwritten font family - see get_fonts

...

other parameters passed on to the sketch_it function

Value

No value returned

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Here make_canvas is inserted in a pipeline after a simplified and tidied 
# map of Irish NUTS3 regions is created.  A sketchy rendition is then added to the
# canvas.
get_fonts()
data(RA) 
RA.spdf %>% small_chop %>% gSimplify(tol=11000) %>% tidy_it %>% clone_data(RA.spdf) -> RA.spdf2
shadecol <- ifelse(RA.spdf2$NUTS2 == 'IE01','indianred','dodgerblue')

RA.spdf2 %>% make_canvas %>% sketch_it(col=shadecol)
c('NUTS2 I','NUTS2 II') %>% hand_legend(-22450,427691,45000,15000,col=c('indianred','dodgerblue'),cex=1.8)

chrisbrunsdon/caricRture documentation built on May 13, 2019, 6:52 p.m.