😎 Give your xaringan slides some style
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

277 lines
13KB

  1. <!-- Generated by pkgdown: do not edit by hand -->
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>An Inverse Plot Theme for ggplot2 by xaringanthemer — theme_xaringan_inverse • xaringanthemer</title>
  9. <!-- jquery -->
  10. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
  11. <!-- Bootstrap -->
  12. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
  13. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
  14. <!-- Font Awesome icons -->
  15. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/all.min.css" integrity="sha256-nAmazAk6vS34Xqo0BSrTb+abbtFlgsFK7NKSi6o7Y78=" crossorigin="anonymous" />
  16. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/v4-shims.min.css" integrity="sha256-6qHlizsOWFskGlwVOKuns+D1nB6ssZrHQrNj1wGplHc=" crossorigin="anonymous" />
  17. <!-- clipboard.js -->
  18. <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
  19. <!-- headroom.js -->
  20. <script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/headroom.min.js" integrity="sha256-DJFC1kqIhelURkuza0AvYal5RxMtpzLjFhsnVIeuk+U=" crossorigin="anonymous"></script>
  21. <script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
  22. <!-- pkgdown -->
  23. <link href="../pkgdown.css" rel="stylesheet">
  24. <script src="../pkgdown.js"></script>
  25. <link href="../extra.css" rel="stylesheet">
  26. <meta property="og:title" content="An Inverse Plot Theme for ggplot2 by xaringanthemer — theme_xaringan_inverse" />
  27. <meta property="og:description" content="Lifecycle: Experimental.
  28. A ggplot2 xaringanthemer plot theme to seamlessly match the &quot;inverse&quot;
  29. xaringan slide colors and styles as styled by xaringanthemer." />
  30. <meta name="twitter:card" content="summary" />
  31. <meta name="robots" content="noindex">
  32. <!-- mathjax -->
  33. <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
  34. <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
  35. <!--[if lt IE 9]>
  36. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  37. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  38. <![endif]-->
  39. </head>
  40. <body>
  41. <div class="container template-reference-topic">
  42. <header>
  43. <div class="navbar navbar-default navbar-fixed-top" role="navigation">
  44. <div class="container">
  45. <div class="navbar-header">
  46. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
  47. <span class="sr-only">Toggle navigation</span>
  48. <span class="icon-bar"></span>
  49. <span class="icon-bar"></span>
  50. <span class="icon-bar"></span>
  51. </button>
  52. <span class="navbar-brand">
  53. <a class="navbar-link" href="../index.html">xaringanthemer</a>
  54. <span class="version label label-danger" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.2.0.9100</span>
  55. </span>
  56. </div>
  57. <div id="navbar" class="navbar-collapse collapse">
  58. <ul class="nav navbar-nav">
  59. <li>
  60. <a href="../index.html">
  61. <span class="fa fa-home fa-lg"></span>
  62. </a>
  63. </li>
  64. <li>
  65. <a href="../articles/xaringanthemer.html">Get started</a>
  66. </li>
  67. <li>
  68. <a href="../reference/index.html">Reference</a>
  69. </li>
  70. <li>
  71. <a href="../articles/themes.html">Themes</a>
  72. </li>
  73. <li>
  74. <a href="../articles/fonts.html">Fonts</a>
  75. </li>
  76. <li>
  77. <a href="../articles/template-variables.html">Template Variables</a>
  78. </li>
  79. <li>
  80. <a href="../articles/css-help.html">CSS Help</a>
  81. </li>
  82. </ul>
  83. <ul class="nav navbar-nav navbar-right">
  84. <li>
  85. <a href="https://github.com/gadenbuie/xaringanthemer">
  86. <span class="fa fa-github fa-lg"></span>
  87. </a>
  88. </li>
  89. <li>
  90. <a href="https://twitter.com/grrrck">
  91. <span class="fa fa-twitter fa-lg"></span>
  92. </a>
  93. </li>
  94. </ul>
  95. </div><!--/.nav-collapse -->
  96. </div><!--/.container -->
  97. </div><!--/.navbar -->
  98. </header>
  99. <div class="row">
  100. <div class="col-md-9 contents">
  101. <div class="page-header">
  102. <h1>An Inverse Plot Theme for ggplot2 by xaringanthemer</h1>
  103. <small class="dont-index">Source: <a href='https://github.com/gadenbuie/xaringanthemer/blob/master/R/ggplot2.R'><code>R/ggplot2.R</code></a></small>
  104. <div class="hidden name"><code>theme_xaringan_inverse.Rd</code></div>
  105. </div>
  106. <div class="ref-description">
  107. <p><strong>Lifecycle:</strong> <a href='https://www.tidyverse.org/lifecycle/#experimental'>Experimental</a>.</p>
  108. <p>A <span class="pkg">ggplot2</span> xaringanthemer plot theme to seamlessly match the "inverse"
  109. <span class="pkg">xaringan</span> slide colors and styles as styled by <a href='xaringanthemer-package.html'>xaringanthemer</a>.</p>
  110. </div>
  111. <pre class="usage"><span class='fu'>theme_xaringan_inverse</span>(
  112. <span class='kw'>text_color</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  113. <span class='kw'>background_color</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  114. <span class='kw'>accent_color</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  115. <span class='kw'>accent_secondary_color</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  116. <span class='kw'>css_file</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  117. <span class='no'>...</span>
  118. )</pre>
  119. <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
  120. <table class="ref-arguments">
  121. <colgroup><col class="name" /><col class="desc" /></colgroup>
  122. <tr>
  123. <th>text_color</th>
  124. <td><p>Color for text and foreground, inherits from <code>text_color</code></p></td>
  125. </tr>
  126. <tr>
  127. <th>background_color</th>
  128. <td><p>Color for background, inherits from
  129. <code>background_color</code></p></td>
  130. </tr>
  131. <tr>
  132. <th>accent_color</th>
  133. <td><p>Color for titles and accents, inherits from
  134. <code>header_color</code></p></td>
  135. </tr>
  136. <tr>
  137. <th>accent_secondary_color</th>
  138. <td><p>Color for secondary accents, inherits from
  139. <code>text_bold_color</code></p></td>
  140. </tr>
  141. <tr>
  142. <th>css_file</th>
  143. <td><p>Path to a <span class="pkg">xaringanthemer</span> CSS file, from which the
  144. theme variables and values will be inferred. In general, if you use the
  145. <span class="pkg">xaringathemer</span> defaults, you will not need to set this. This feature
  146. lets you create a <span class="pkg">ggplot2</span> theme for your <span class="pkg">xaringan</span> slides, even
  147. if you have only saved your theme CSS file and you aren't creating your
  148. CSS theme with <span class="pkg">xaringanthemer</span> in your slides' source file.</p></td>
  149. </tr>
  150. <tr>
  151. <th>...</th>
  152. <td><p>Arguments passed on to <code><a href='theme_xaringan_base.html'>theme_xaringan_base</a></code></p><dl class='dl-horizontal'>
  153. <dt><code>set_ggplot_defaults</code></dt><dd><p>Should defaults be set for <span class="pkg">ggplot2</span> <em>geoms</em>?
  154. Defaults to TRUE. To restore ggplot's defaults, or the previously set geom
  155. defaults, see <code><a href='theme_xaringan_set_defaults.html'>theme_xaringan_restore_defaults()</a></code>.</p></dd>
  156. <dt><code>text_font</code></dt><dd><p>Font to use for text elements, passed to
  157. <code><a href='https://rdrr.io/pkg/sysfonts/man/font_add_google.html'>sysfonts::font_add_google()</a></code>, if available and <code>text_font_use_google</code> is
  158. <code>TRUE</code>. Inherits from <code>text_font_family</code>.</p></dd>
  159. <dt><code>text_font_use_google</code></dt><dd><p>Is <code>text_font</code> available on <a href='https://fonts.google.com'>Google Fonts</a>?</p></dd>
  160. <dt><code>text_font_size</code></dt><dd><p>Base text font size, inherits from <code>text_font_size</code>, or
  161. defaults to 11.</p></dd>
  162. <dt><code>title_font</code></dt><dd><p>Font to use for title elements, passed to
  163. <code><a href='https://rdrr.io/pkg/sysfonts/man/font_add_google.html'>sysfonts::font_add_google()</a></code>, if available and <code>title_font_use_google</code> is
  164. <code>TRUE</code>. Inherits from <code>title_font_family</code>.</p></dd>
  165. <dt><code>title_font_use_google</code></dt><dd><p>Is <code>title_font</code> available on <a href='https://fonts.google.com'>Google Fonts</a>?</p></dd>
  166. <dt><code>title_font_size</code></dt><dd><p>Base text font size, inherits from <code>title_font_size</code>,
  167. or defaults to 14.</p></dd>
  168. </dl></td>
  169. </tr>
  170. </table>
  171. <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
  172. <p>A ggplot2 theme</p>
  173. <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
  174. <div class='dont-index'><p>Other xaringanthemer ggplot2 themes:
  175. <code><a href='theme_xaringan_base.html'>theme_xaringan_base</a>()</code>,
  176. <code><a href='theme_xaringan_set_defaults.html'>theme_xaringan_set_defaults</a>()</code>,
  177. <code><a href='theme_xaringan.html'>theme_xaringan</a>()</code></p></div>
  178. <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
  179. <pre class="examples"><div class='input'><span class='co'># Requires ggplot2</span>
  180. <span class='no'>has_ggplot2</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/ns-load.html'>requireNamespace</a></span>(<span class='st'>"ggplot2"</span>, <span class='kw'>quietly</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
  181. <span class='kw'>if</span> (<span class='no'>has_ggplot2</span>) {
  182. <span class='co'># Because this is an example, we'll save the CSS to a temp file</span>
  183. <span class='no'>path_to_css_file</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/tempfile.html'>tempfile</a></span>(<span class='kw'>fileext</span> <span class='kw'>=</span> <span class='st'>".css"</span>)
  184. <span class='co'># Create the xaringan theme: dark blue background with teal green accents</span>
  185. <span class='fu'><a href='style_duo.html'>style_duo</a></span>(
  186. <span class='kw'>primary_color</span> <span class='kw'>=</span> <span class='st'>"#002b36"</span>,
  187. <span class='kw'>secondary_color</span> <span class='kw'>=</span> <span class='st'>"#31b09e"</span>,
  188. <span class='co'># Using basic fonts for this example, but the plot theme will</span>
  189. <span class='co'># automatically use your theme font if you use Google fonts</span>
  190. <span class='kw'>text_font_family</span> <span class='kw'>=</span> <span class='st'>"sans"</span>,
  191. <span class='kw'>header_font_family</span> <span class='kw'>=</span> <span class='st'>"serif"</span>,
  192. <span class='kw'>outfile</span> <span class='kw'>=</span> <span class='no'>path_to_css_file</span>
  193. )
  194. <span class='fu'><a href='https://rdrr.io/r/base/library.html'>library</a></span>(<span class='no'>ggplot2</span>)
  195. <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span>(<span class='no'>iris</span>) +
  196. <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/aes.html'>aes</a></span>(<span class='no'>Petal.Length</span>, <span class='no'>Petal.Width</span>) +
  197. <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/geom_point.html'>geom_point</a></span>() +
  198. <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/labs.html'>ggtitle</a></span>(<span class='st'>"Yet another Iris plot"</span>) +
  199. <span class='co'># themed to match the inverse slides: teal background with dark blue text</span>
  200. <span class='fu'>theme_xaringan_inverse</span>()
  201. }</div><div class='img'><img src='theme_xaringan_inverse-1.png' alt='' width='700' height='433' /></div></pre>
  202. </div>
  203. <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
  204. <h2>Contents</h2>
  205. <ul class="nav nav-pills nav-stacked">
  206. <li><a href="#arguments">Arguments</a></li>
  207. <li><a href="#value">Value</a></li>
  208. <li><a href="#see-also">See also</a></li>
  209. <li><a href="#examples">Examples</a></li>
  210. </ul>
  211. </div>
  212. </div>
  213. <footer>
  214. <div class="copyright">
  215. <p>Developed by <a href='https://www.garrickadenbuie.com'>Garrick Aden-Buie</a>.</p>
  216. </div>
  217. <div class="pkgdown">
  218. <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.4.1.</p>
  219. </div>
  220. </footer>
  221. </div>
  222. </body>
  223. </html>