🍑 Pomological plot theme for ggplot2
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

103 lines
3.3KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/theme_pomological.R
  3. \name{theme_pomological}
  4. \alias{theme_pomological}
  5. \alias{theme_pomological_nobg}
  6. \alias{theme_pomological_plain}
  7. \title{Pomological Theme}
  8. \usage{
  9. theme_pomological(base_family = "Homemade Apple", base_size = 16,
  10. text.color = pomological_base$dark_blue,
  11. plot.background.color = pomological_base$paper,
  12. panel.border.color = pomological_base$light_line, with.panel.grid = FALSE,
  13. panel.grid.color = pomological_base$light_line,
  14. panel.grid.linetype = "dashed",
  15. axis.text.color = pomological_base$medium_line, axis.text.size = base_size
  16. * 14/16, base_theme = ggplot2::theme_minimal())
  17. theme_pomological_nobg(...)
  18. theme_pomological_plain(...)
  19. }
  20. \arguments{
  21. \item{base_family, base_size}{Base text family and size}
  22. \item{text.color}{Color of all text (except axis text, see \code{axis.text.color})}
  23. \item{plot.background.color}{Color of plot background, passed to \code{plot.background}}
  24. \item{panel.border.color}{Color of plot panel border}
  25. \item{with.panel.grid}{If \code{FALSE} gridlines in plot are removed}
  26. \item{panel.grid.color, panel.grid.linetype}{Color and linetype of panel grid, passed to \code{panel.grid}}
  27. \item{axis.text.color, axis.text.size}{Color and size of axis text}
  28. \item{base_theme}{Starting theme of plot, default is
  29. \code{\link[ggplot2:theme_minimal]{ggplot2::theme_minimal()}}. Any elements set by \code{theme_pomological()} will
  30. overwrite the \code{base_theme} unless the specific parameter is explicitly set
  31. to \code{NULL}.}
  32. }
  33. \description{
  34. \link{ggplot2} plot theme based on the USDA Pomological Watercolors paintings.
  35. }
  36. \section{Functions}{
  37. \itemize{
  38. \item \code{theme_pomological_nobg}: Pomological theme with white (transparent) background
  39. \item \code{theme_pomological_plain}: A "plain" pomological theme with white
  40. background and normal fonts.
  41. }}
  42. \section{Fonts}{
  43. Complete the pomological watercolor theme with a handwriting or cursive font.
  44. The following fonts from \href{https://fonts.google.com}{Google Fonts} work well.
  45. Visit the links below to install on your system.
  46. \itemize{
  47. \item \href{https://fonts.google.com/specimen/Homemade+Apple/}{Homemade Apple}
  48. \item \href{https://fonts.google.com/specimen/Amatic+SC/}{Amatic SC}
  49. \item \href{https://fonts.google.com/specimen/Mr+Bedfort/}{Mr. Bedfort}
  50. }
  51. Fonts with R are notoriously tricky, so these may not work well for you. If
  52. you have installed the fonts but they aren't showing up or working, you can
  53. always try running \code{extrafont::font_import()} or \code{extrafont::load_fonts()} in
  54. the session or RMarkdown document. Or you can use \code{\link[=theme_pomological_plain]{theme_pomological_plain()}}.
  55. }
  56. \examples{
  57. library(ggplot2)
  58. basic_iris_plot <- ggplot(iris) +
  59. aes(x = Sepal.Length, y = Sepal.Width, color = Species) +
  60. geom_point(size = 2) +
  61. # with pomological color scale
  62. scale_color_pomological()
  63. # Pomological Theme
  64. basic_iris_plot +
  65. theme_pomological()
  66. # Don't change panel grid color
  67. basic_iris_plot +
  68. theme_pomological(
  69. panel.grid.color = NULL
  70. )
  71. # White background
  72. basic_iris_plot +
  73. theme_pomological_nobg()
  74. # Plain plot without font or background
  75. basic_iris_plot +
  76. theme_pomological_plain()
  77. }
  78. \references{
  79. https://usdawatercolors.nal.usda.gov/pom
  80. }
  81. \seealso{
  82. \link[ggplot2:theme]{ggplot2::theme}
  83. }