Created
October 11, 2017 01:34
-
-
Save eliocamp/7609fae98632b5af9a05d37262337bb9 to your computer and use it in GitHub Desktop.
Test for fig.ncol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Untitled" | |
author: "Elio" | |
output: | |
pdf_document: | |
keep_tex: yes | |
fig_caption: yes | |
header-includes: | |
- \usepackage{subfig} | |
--- | |
Some tests: | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
Intended use: | |
```{r pressure, out.extra = "", echo = FALSE, fig.show = "hold", fig.cap = "Pressure", fig.subcap = c("one","two", "tree"), fig.ncol = 2, out.width = "0.48\\textwidth"} | |
plot(pressure) | |
ggplot2::qplot(temperature, pressure, data = pressure) | |
plot(pressure) | |
``` | |
Previous behaviour: | |
```{r pressure1, out.extra = "", echo = FALSE, fig.show = "hold", fig.cap = "Pressure", fig.subcap = c("one","two", "tree"), out.width = "0.48\\textwidth"} | |
plot(pressure) | |
ggplot2::qplot(temperature, pressure, data = pressure) | |
plot(pressure) | |
``` | |
Previous behaviour again: | |
```{r pressure5, out.extra = "", echo = FALSE, fig.show = "hold", fig.cap = "Pressure", fig.subcap = c("one","two", "tree"), fig.ncol = 3, out.width = "0.48\\textwidth"} | |
plot(pressure) | |
ggplot2::qplot(temperature, pressure, data = pressure) | |
plot(pressure) | |
``` | |
Centering works... interestingly: | |
```{r pressure3, out.extra = "", echo = FALSE, fig.show = "hold", fig.cap = "Pressure", fig.subcap = c("one","two", "tree"), fig.ncol = 2, out.width = "0.48\\textwidth", fig.align='center'} | |
plot(pressure) | |
ggplot2::qplot(temperature, pressure, data = pressure) | |
plot(pressure) | |
``` | |
Some stress testing: | |
One plot | |
```{r pressure4, out.extra = "", echo = FALSE, fig.show = "hold", fig.cap = "Pressure", fig.subcap = c("one","two", "tree"), fig.ncol = 2, out.width = "0.48\\textwidth", fig.align='center'} | |
plot(pressure) | |
``` | |
Negative | |
```{r pressure10, out.extra = "", echo = FALSE, fig.show = "hold", fig.cap = "Pressure", fig.subcap = c("one","two", "tree"), fig.ncol = -1, out.width = "0.48\\textwidth", fig.align='center'} | |
plot(pressure) | |
``` | |
No fig.show | |
```{r pressure11, out.extra = "", echo = FALSE, fig.cap = "Pressure", fig.subcap = c("one","two", "tree"), fig.ncol = -1, out.width = "0.48\\textwidth", fig.align='center'} | |
plot(pressure) | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment