thlPlotLogo: Insert THL logo to a plot

Description Usage Arguments Author(s) Examples

View source: R/thlPlotLogo.R

Description

Insert THL logo to a plot

Usage

1
(label, lang = "fi", x, y, size, fontsize)

Arguments

label

Label before the logo

lang

Language of logo

x

x-position of the logo

y

y-position of the logo

size

Logo size

fontsize

Label fontsize

Author(s)

Petteri Mäntymaa, Tarja Palosaari, Salla Toikkanen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Generate data for demonstration 
year <- 1999:2017
set.seed(1234)
value1 <- jitter(c(250:(250+length(year)-1)), factor = 100)*1000
value2 <- jitter(c(200:(200-length(year)+1)), factor = 300)*1000
value3 <- jitter(c(100:(100-length(year)+1)), factor = 400)*1000
dat <- data.frame(year = rep(year,3), value = c(value1, value2, value3), 
                group = factor(rep(c("Rabbits", "Magicians", "Playing cards"), each = length(year))))
dat$value <- with(dat, ifelse(year %in% c(2012,2013) & group == "Rabbits", NA, value))
dat$value <- with(dat, ifelse(year == 2007 & group == "Magicians", NA, value))

## Default line plot:
thlLinePlot(data = subset(dat, year<2007), xvar = year, yvar = value, 
                   groupvar = group, ylimits = c(0,350000))
## Add THL logo to the plot                   
("Source: ", "en", .71, .02, 0.9, fontsize = 10)

THLfi/thlGraphs documentation built on Oct. 31, 2019, 12:09 a.m.