在Markdown中的图周围换行 [英] Wrap text around plots in Markdown

查看:170
本文介绍了在Markdown中的图周围换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在问这个问题: 如何在R Markdown中的图周围包裹文本? :

I am reasking this question: How to wrap text around plots in R Markdown?:

'当前,R中R Markdown的默认设置是使一行文本与图线对齐,但这看起来很尴尬,我想通过将文本环绕图线来节省空间(图线向左对齐,以右边的文字环绕."

'Currently the default for R Markdown in R is to have one line of text in line with the plot but this looks very awkward and I would like to save space by having the text wrap around the plot (plot aligned left, with text wrapping on the right).'

推荐答案

您可以使用CSS样式随意放置元素.但是,可能会有一些困难,并且确实需要进行一些调整.这是一个简单的示例:

You can use CSS styling to position the elements however you want. However there can be some difficulties and it does require some tweaking. Here is a simple example:

---
title: "Untitled"
author: "Ian Wesley"
date: "April 21, 2017"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown
<div style= "float:right;position: relative; top: -80px;">
```{r pressure, echo=FALSE}
plot(pressure)
```
</div>

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

收益:

这篇关于在Markdown中的图周围换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆