inst/tinytest/test-plot.R

options(tinysnapshot_os = "Windows") # see Sys.info()["sysname"]
options(tinysnapshot_device = "svglite")
options(tinysnapshot_device_args = list(user_fonts = fontquiver::font_families("Liberation")))


using("tinysnapshot")
library(ggplot2)


p <- ggplot(airquality, aes(Day, Wind, group = Month)) + 
  stat_interquartilerange(geom = "ribbon",
                          show.legend = FALSE) +
  geom_line() + 
  stat_sparklabels(geom = "label", label_fun = \(x) round(x, 0),
                   show.legend = FALSE) +
  scale_y_continuous(limits = c(0, 25)) + 
  facet_grid(Month~.) +
  ggtitle("Daily wind intensity by month in NYC") + 
  theme_minimal()


expect_snapshot_plot(p, label = "ggplot2_example")

Try the ggspark package in your browser

Any scripts or data that you put into this service are public.

ggspark documentation built on May 29, 2024, 11:47 a.m.