Fix warning `Lato font not found`
tschaffter opened this issue · 0 comments
tschaffter commented
The issue appeared first in #80.
> library("sagethemes")
> head(sage_colors, n = 3)
$royal
200 300 400 500 600 700 800
"#D5CFE3" "#B2A5D1" "#907FBA" "#5A478F" "#47337D" "#332069" "#251454"
$powder
200 300 400 500 600 700 800
"#E1F4F5" "#C5EDF0" "#A6DDE0" "#7EC8CC" "#5BB0B5" "#2F8E94" "#0C656B"
$coral
200 300 400 500 600 700 800
"#F7E2DF" "#FFC5BD" "#FCA79A" "#F47E6C" "#DA614F" "#BD422F" "#8F1D0B"
> library("ggplot2")
> library("extrafont")
Registering fonts with R
> library("sagethemes")
>
> # discrete
> ggplot(mpg, aes(displ, hwy, colour = class)) +
+ geom_point() +
+ scale_color_sage_d() +
+ theme_sage()
Warning: Lato font not found; falling back to ggplot2 default. Please install Lato on your system.
> ggplot(mpg, aes(x = factor(year), fill = class)) +
+ geom_bar() +
+ scale_fill_sage_d() +
+ theme_sage()
Warning: Lato font not found; falling back to ggplot2 default. Please install Lato on your system.
> # continuous
> ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
+ geom_tile() +
+ scale_fill_sage_c(option = "powder") +
+ theme_sage()
Warning: Lato font not found; falling back to ggplot2 default. Please install Lato on your system.
> # binned -- note this requires ggplot2 version 3.3.1.9000 or greater
> ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
+ geom_tile() +
+ scale_fill_sage_b(option = "powder") +
+ theme_sage()
Warning: Lato font not found; falling back to ggplot2 default. Please install Lato on your system.
> ggplot(mpg, aes(displ, hwy, colour = class)) +
+ geom_point() +
+ scale_color_sage_d() +
+ theme_sage() +
+ labs(
+ title = "Gas mileage",
+ subtitle = "Highway miles per gallon vs. engine displacement in liters"
+ ) +
+ logo_image() +
+ logo_layout()
Warning: Lato font not found; falling back to ggplot2 default. Please install Lato on your system.