我正在尝试从 ioslide 切换到 xaringan。我无法正确调整 ggplot 图像的大小以制作全屏或至少占据尽可能多的空间。我同时使用了 fig.height/width
和 out.height/width
参数,但只改变了一个维度。有没有更好的方法来调整图像的大小?
这是设置:
---
title: ""
author: ""
institute: ""
date: "`r Sys.Date()`"
output:
xaringan::moon_reader:
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
ratio: 16:9
---
#```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
knitr::opts_chunk$set(fig.retina=2)
library(Cairo)
library(cairoDevice)
library(tidyverse)
library(kableExtra)
#```
---
# Plot
#```{r echo=FALSE, out.height=450, out.width= 2000}
knitr::include_graphics("img/Rplot01.svg")
#```
我想尽可能地扩大图像
最佳答案
设置图片大小
您可以使用 Markdown 标签,例如:
![:scale 50%](image.jpg)
参见 this
作为背景图片:
在 Xaringan 中,您可以像这样添加图像:
---
class: inverse, center, middle
background-image: url(img/Rplot01.svg)
background-size: contain
请检查url中的信息是否正确。
作为指南,您可以查看 this presentation (该链接将带您前往第 9 号幻灯片,其中有一张图片)使用 this code 生成(见第 76 行)
关于html - 如何在 Xaringan 演示文稿中调整图像大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58581418/