knitr: How to show two plots of different sizes next to each other?

前端 未结 4 658
萌比男神i
萌比男神i 2020-12-09 11:28

I wanted to generate two images of different sizes, but show them side-by-side. Is this possible?

This works, but then they have to be the same size:



        
4条回答
  •  抹茶落季
    2020-12-09 12:06

    One option would be to make a single wide graph with the R commands and give knitr just the one graph to deal with, maybe something like:

    ```{r fig.width=10, fig.height=9}
    layout( cbind( c(0,0,1,1,1,1,1,0,0), rep(2,9) ) )
    plot(...)
    plot(...)
    ```
    

提交回复
热议问题