Skip to content

Instantly share code, notes, and snippets.

@hepplerj
Last active Jan 14, 2020
Embed
What would you like to do?
Hex logo generator for R User Group
library(hexSticker)
library(tidyverse)
library(tidycensus)
library(sf)
library(viridis)
options(tigris_use_cache = TRUE)
nebraska_raw <- get_acs(state = "NE",
geography = "tract",
variables = "B01003_001",
geometry = TRUE)
area <- nebraska_raw %>%
select(geometry) %>%
st_area() %>%
as.numeric()
nebraska <- bind_cols(nebraska_raw, tibble(area = area))
ne <- nebraska %>%
ggplot(aes(fill = log2((estimate + 25) / area),
color = log2((estimate + 25) / area))) +
geom_sf() +
scale_fill_viridis(begin=.3, end=.9) +
scale_color_viridis(begin=.3, end=.9) +
theme_minimal() +
theme(legend.position="none") +
theme(axis.text.x=element_blank(),
axis.text.y=element_blank(),
panel.grid.major = element_line(colour = "transparent")) +
theme_transparent()
ne
# Logo
sysfonts::font_add_google("Josefin Sans", "josefin")
sticker(ne,
package = "UNOR",
p_size = 12.5,
p_y = 1,
p_family = "josefin",
p_color = "#ffffff",
h_fill = "#453781FF",
h_color = "#ffffff",
h_size = 2,
s_x = 1, s_y = 1,
s_width = 4.9, s_height = 4.9,
url = "github.com/unolibraries/",
u_color = "#ffffff",
u_size = 1.2,
filename="unor_hex.png")
# UNO logo version
img <- "https://upload.wikimedia.org/wikipedia/commons/c/c6/University_of_Nebraska_Omaha_%22O%22.png"
sticker(img, package="r-mavs",
p_size=12, p_y = 1.5, s_x = 1, s_y = 0.75, s_width = 0.5, s_height = 0.5,
p_family = "josefin",
h_fill = "#FFFFFF", p_color = "#D71920", h_color = "#D71920",
filename="unor_hex2.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment