旁边的情节

时间:2017-11-30 15:12:37

标签: r ggplot2

使用以下代码行,我可以生成图表:

    #Delete all files, keep last 10 versions#

$Directory = "D:\Octopus\Packages"
$Keep = "10"

Get-ChildItem $Directory| ?{ $_.PSIsContainer } | Select-Object FullName | Export-Csv $Directory\FolderList.csv

$FolderList = import-csv $Directory\FolderList.csv

ForEach ($row in $FolderList)
{
Get-ChildItem -Recurse | where{-not $_.PsIsContainer}| sort CreationTime -desc | select -Skip $Keep | Remove-Item -Force
}

与我制作6个地块的方式相同。

如何将第一行中同一图像中的这六个图块设为3,而第一个图像中的第二个图像有另外三个?

2 个答案:

答案 0 :(得分:4)

Width完成这项工作

grid.extra

enter image description here

答案 1 :(得分:2)

另一种方法是使用cowplot

library(cowplot)
plot_grid(p1,p2,p3,p4,p5,p6, ncol = 3, align = "v")

enter image description here

如果您想在rel_heights命令中使用plot_grid,还可以调整每行的高度。第1行将是第2行的一半高度。

plot_grid(p1,p2,p3,p4,p5,p6, ncol = 3, align = "v", rel_heights = c(1,2))

enter image description here

或者您可以使用rel_widths调整每列的宽度。第1列将是第2列和第3列的宽​​度的一半

plot_grid(p1,p2,p3,p4,p5,p6, ncol = 3, align = "v", rel_widths = c(1,2,2))

enter image description here