Skip to content

Instantly share code, notes, and snippets.

@yjunechoe
Created April 2, 2021 01:09
Show Gist options
  • Save yjunechoe/c46da7c811b435fce694fff3b2441235 to your computer and use it in GitHub Desktop.
Save yjunechoe/c46da7c811b435fce694fff3b2441235 to your computer and use it in GitHub Desktop.
library(ggplot2)
library(ggfx)
library(ragg)
ggplot(NULL) +
as_reference(
geom_rect(
aes(xmin = -1, xmax = 1, ymin = -.6, ymax = -.6 + 1.2 * (8/60)),
fill = '#961A1F',
),
id = "part"
) +
with_blend(
geom_text(
aes(0, 0, label = "school"),
color = "#1F2854",
size = 99,
family = "Material Icons"
),
bg_layer = "part",
flip_order = TRUE,
blend_type = 'atop'
) +
geom_text(
aes(0, .2, label = "87%"),
color = "white",
size = 12,
family = "Supply"
) +
geom_text(
aes(0, .05, label = "to go"),
color = "white",
size = 6,
family = "Supply"
) +
geom_text(
aes(0, -.5, label = "13%"),
color = "white",
size = 6,
family = "Supply"
) +
theme_void() +
coord_cartesian(xlim = c(-1, 1), ylim = c(-1, 1)) +
theme(plot.background = element_rect(fill = "#C9C9C9"))
@yjunechoe
Copy link
Author

Rplot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment