thlPlotLogo | R Documentation |
Insert THL default logo to a plot
thlPlotLogo(x, y, size)
x |
x-position of the logo |
y |
y-position of the logo |
size |
Logo size |
Petteri Mäntymaa, Tarja Palosaari, Salla Toikkanen
## Not run: ## 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 thlPlotLogo(0.78, 0.92, 1.7) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.