簡體   English   中英

如何在 r markdown 和 bookdown 中的圖形標題下方創建圖形注釋

[英]How to create a figure note below the figure caption in r markdown and bookdown

我正在努力在r markdownbookdown的圖形標題下方創建圖形注釋。 我想要的圖注如下所示。 這個數字來自(Greenstone and Hanna 2014) 我的圖實際上是r plot。 注釋的長度應與圖形寬度相同,並自動換行。 有任何想法嗎???

在此處輸入圖像描述

如果您使用的是通過 LaTeX 的格式(例如pdf_bookpdf_document ),這是可能的。 我不知道有沒有辦法用 HTML output 做到這一點。 (但這會移動數字嗎?也許數字下方的純文本就足夠了)。 這個想法是輸入 LaTeX 代碼來自己開始和結束圖,並在該塊中包含注釋。 這是一個基於標准pdf_document示例的示例。

---
title: "Untitled"
output: 
  pdf_document
---

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

## Including Plots

You can also embed plots, for example:  Figure \ref{fig:pressure}.
```{=latex}
\begin{figure}[t]
```
```{r pressure, echo=FALSE}
plot(pressure)
```
```{=latex}
\caption{Air quality monitors across India. \label{fig:pressure}}
\textit{Notes:} Dots denote cities with monitoring stations
under India's National Ambient Air Monitoring Programme
(NAAMP).  Geographical data are drawn from MIT's Geodata
Repository.
\end{figure}
```

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM