减少绘图ggplot2之间的空间

时间:2018-12-18 16:24:49

标签: r ggplot2 grid spacing bookdown

我正在使用const inner = Vue.component('inner', { template: ` <div> <span hidden="true"><slot></slot></span> <input v-model="searchText" /> </div> `, props: ['placeholder'], data: function() { return { searchText: this.placeholder } } }); const outer = Vue.component('outer', { template: ` <div> <h3 v-on:click="testos">Hello: {{ client_id }}</h3> <slot></slot> </div> `, data: function() { return { client_id: '' } }, methods: { testos: function() { this.client_id = this.$parent.$refs.testref.searchText; console.log('method', this.client_id); } } }) new Vue({ el: '#app', components: { 'inner': inner, 'outer': outer } })<script src="https://unpkg.com/vue@latest/dist/vue.js"></script> <div id="app"> <outer> <div> <form> <inner ref="testref"></inner> </form> </div> </outer> </div>软件包。我正在尝试渲染一个pdf文件,使之可以适合彼此之间具有最小间距的一系列绘图

bookdown

emmeans看起来像这样:

```{r 3AeMixEffCmass,out.width = c("32%","32%","32%"), fig.align = "center", fig.pos="!h",fig.show = 'hold',fig.cap='(ref:3AeMixEffCmass)', message=FALSE, warning=FALSE, echo=FALSE}

### plot letter identifier:
library(grid)
my_grob = grobTree(textGrob("A1", x=0.85,  y=0.95, hjust=0,  gp=gpar(col="black", fontsize=15, fontface="italic")))


library(ggplot2)
### Order the levels for printing:
cld.mixed_C_L$managem = factor(cld.mixed_C_L$managem, levels=c("WTH", "CH", "CHF")) 
### reset row number: 
cld.mixed_C_L<- with(cld.mixed_C_L, cld.mixed_C_L[order(managem),])
rownames(cld.mixed_C_L) <- NULL 

创建情节:

cld.mixed_C_L

最终pdf文档的结果如下: enter image description here

我一直在试图找出如何减少地块之间的空间,但是到目前为止,我还没有运气。任何帮助表示赞赏。

非常感谢。

问题的大小不匹配

(请参阅评论) enter image description here

1 个答案:

答案 0 :(得分:0)

从块选项中删除out.width = c("32%","32%","32%"),然后使用cowplot的{​​{1}}函数,如下所示:

plot_grid

enter image description here