Skip to contents
#> Package fonts loaded. See `?load_pkg_fonts` for details.
#> Registering fonts with R
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

Examples


# Call the function to update the geom_default fonts
update_geom_fonts_emw()

# Create line chart 
df <- season_summary |> 
  filter(version == "US",
         season < 10) |> 
  select(season, n_cast)

person <- "<span style='font-family:fa-solid'>&#xf183;</span>"
txt <- "grey20"
# 📊 plot --------------------------------------------------------------------

df |> 
  ggplot() +

  geom_richtext(aes(n_cast, -season, label = person, color = season), label.colour = NA, fill = NA) +
  geom_text(aes(0, -season, label = season), family = 'Oswald', color = txt, size = 16) +
  geom_text(aes(n_cast, 0, label = n_cast), family = 'Oswald', color = txt, size = 16) +
  annotate("text", x = 1, y = 1, label = "Sauce number", family = 'Oswald', color = txt, size = 16, hjust = 0) +
  #scale_color_emw_c("Corals") +
 #scale_fill_emw_c("Corals") +
  labs(
    title = "HOT ONES!",
    colour = "Scoville units"
    ) +
  coord_cartesian(clip = "off") +
  theme_unl_dark()
 

#ggsave("line-viewers.png", device = "png", type = "cairo", width = 8, height = 5, dpi = 300)
Example plot with labels
Example plot with labels

Example with markdown element

line +
   theme_em(md=TRUE) 


ggsave("line-viewers-md.png", device = "png", type = "cairo", width = 8, height = 5, dpi = 300)
Example plot with labels
Example plot with labels