Created
June 25, 2023 22:01
-
-
Save vgXhc/23d0142c8fae4e803abbc74b06124e98 to your computer and use it in GitHub Desktop.
Code for making the hex sticker for the ntdr package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(hexSticker) | |
| library(ggplot2) | |
| library(ntdr) | |
| library(cowplot) | |
| library(tidyverse) | |
| bus <- magick::image_read_svg("c:/Users/user1/Downloads/train bus ferry.svg") | |
| madison_bus <- get_ntd(agency = "City of Madison", modes = "MB") | |
| p <- madison_bus |> | |
| filter(value != 0) |> | |
| ggplot(aes(x = month, y = value)) + geom_line(alpha = .7) | |
| p <- p + theme_void() + theme_transparent() | |
| q <- ggdraw() + | |
| draw_image(bus, y = -.25, scale = .58) + | |
| draw_plot(p) | |
| sticker(q, package="ntdr", p_size=26, s_x=1, s_y=.8, s_width=1.3, s_height=1, | |
| p_y = 1.5, | |
| h_fill = "#C8DF52", | |
| h_color = "#DBE8D8", | |
| filename="c:/Users/user1/Desktop/tbd/sticker.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment