A function to replace axis labels and/or graph title with light gray prompts for each field.

blank_labs(
  x_txt = "ADD X-AXIS LABEL",
  y_txt = "ADD Y-AXIS LABEL",
  title_txt = "ADD FIGURE TITLE",
  txt_col = "gray92",
  font.face = 4
)

Arguments

x_txt

X-Axis Label prompt text (watermarked on blank); default= "ADD X-AXIS LABEL"; "" will keep spacing, with no text prompt; NA will pass-through label and not overwrite

y_txt

Y-Axis Label prompt text (watermarked on blank); default= "ADD Y-AXIS LABEL"; "" will keep spacing, with no text prompt; NA will pass-through label and not overwrite

title_txt

Graph Title prompt text (watermarked on blank); default= "ADD FIGURE TITLE"; "" will keep spacing, with no text prompt; NA will pass-through label and not overwrite

txt_col

Color of prompt text; default= "gray92" (a very faint gray--you can use gray1 to gray99 to have the equivalent of changing transparency)

font.face

style of axis label and title fonts; 1=plain, 2= bold, 3=italic, 4=bold+italic; Provide 1 value for all or 3 values for title, x-axis label, y-axis label (in that order); default= 4

Examples

#> Loading required package: ggplot2
#> Want to understand how all the pieces fit together? Read R for Data #> Science: https://r4ds.had.co.nz/
ggplot(mtcars,aes(x=mpg,y=hp))+geom_point()+theme_galactic()
ggplot(mtcars,aes(x=mpg,y=hp))+geom_point()+theme_galactic()+blank_labs()