A custom ggplot theme
theme_kim(
legend_position = "none",
legend_spacing_y = 1,
legend_key_size = 3,
base_size = 20,
axis_tick_font_size = 20,
axis_tick_marks_color = "black",
axis_title_font_size = 24,
y_axis_title_vjust = 0.85,
axis_title_margin_size = 24,
cap_axis_lines = FALSE
)
a ggplot object; there will be no meaningful output from
this function. Instead, this function should be used with another
ggplot object, e.g.,
ggplot(mtcars , aes(x = disp, y = mpg)) + theme_kim()
position of the legend (default = "none")
vertical spacing of the legend keys in the unit of "cm" (default = 1)
size of the legend keys in the unit of "lines" (default = 3)
base font size
font size for axis tick marks
color of the axis tick marks
font size for axis title
position of the y axis title (default = 0.85).
If default is used, y_axis_title_vjust = 0.85
, the y axis title
will be positioned at 85% of the way up from the bottom of the plot.
size of the margin between axis title and the axis line
logical. Should the axis lines be capped at the outer tick marks? (default = FALSE)
If a axis lines are to be capped at the ends, the following package(s) must be installed prior to running the function: Package 'lemon' v0.4.4 (or possibly a higher version) by Edwards et al. (2020), https://cran.r-project.org/package=lemon
# \donttest{
prep(ggplot2)
ggplot2::ggplot(mtcars, aes(x = cyl, y = mpg)) +
geom_point() + theme_kim()
# }
Run the code above in your browser using DataLab