library(tidyverse)
library(sf)
library(spData)
::world spData
# save final plot
::agg_png(here::here("/Users/federica/Documents/R/R_general_resources/30DayMapChallenge/day9_monochrome/monochrome.png"),
raggres = 320, width = 6, height = 6, units = "in")
= world[world$continent == "Europe", ]
world_europe = world[world$name_long == "Italy", ]
italy plot(st_geometry(italy), expandBB = c(0, 0.2, 0.1, 1), col = "gray", lwd = 3)
plot(world_europe[0], add = TRUE)
dev.off()
library(cowplot)
library(magick)
<- image_read("/Users/federica/Documents/R/R_general_resources/30DayMapChallenge/day9_monochrome/monochrome.png")
mono_it
library(showtext)
library(extrafont)
::font_info_google("Josefin Sans")
sysfonts#fonts()
#loadfonts()
font_add_google("Josefin Sans","josefin")
showtext_opts(dpi = 320)
showtext_auto(enable = T)
<-ggplot()+geom_blank()+xlim(0,50)+ylim(0,50)+theme_void()
empty
<- grid::circleGrob(gp = grid::gpar(fill = NA,color="black"))
g
<- ggdraw()+
final draw_plot(empty)+
draw_image(mono_it, x = 0, y = 0,width = 1)+
draw_text("Monochrome Italy",x=0.5,y=0.91,angle=0,family="josefin")+
draw_text("Datasource: spData::world\nInfographics: Federica Gazzelloni",x=0.5,y=0.15,family="josefin",size=9)+
draw_grob(g, scale = 1)
::agg_png(here::here("/Users/federica/Documents/R/R_general_resources/30DayMapChallenge/day9_monochrome/monochrome.png"),
raggres = 320, width = 6, height = 6, units = "in")
finaldev.off()