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

前端 未结 4 661
萌比男神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条回答
  •  Happy的楠姐
    2020-12-09 11:57

    Yet another option is to use a vector for out.width or out.height, if you do not mind resizing the plots, e.g.

    ```{r out.width=c('500px', '300px'), fig.show='hold'}
    boxplot(1:10)
    plot(rnorm(10))
    ```
    

提交回复
热议问题