我正在学习 R,我想使用 R 中的 patchwork 包生成 11 个图(一列)的长而可读的图像。但是,由于图太多,输出图像会失真/压扁并且不可读。这是我的代表:
data(diamonds)
library(ggplot2)
library(patchwork)
a <- ggplot(data = diamonds, aes(y = clarity)) +
geom_bar(stat = "count", orientation = "y")
b <- ggplot(data = diamonds, aes(y = color)) +
geom_bar(stat = "count", orientation = "y")
c <- ggplot(data = diamonds, aes(y = table)) +
geom_bar(stat = "count", orientation = "y")
d <- ggplot(data = diamonds, aes(y = cut)) +
geom_bar(stat = "count", orientation = "y")
e <- ggplot(data = diamonds, aes(y = x)) +
geom_bar(stat = "count", orientation = "y")
f <- ggplot(data = diamonds, aes(y = depth)) +
geom_bar(stat = "count", orientation = "y")
g <- ggplot(data = diamonds, aes(y = carat)) +
geom_bar(stat = "count", orientation = "y")
h <- ggplot(data = diamonds, aes(y = z)) +
geom_bar(stat = "count", orientation = "y")
a + b + c + d + e + f + g + h +
plot_layout(ncol = 1)
如果可能的话,我如何锁定方面以便它在 MS Word 中可读甚至可滚动?
如果我可以提供更多信息或需要使用不同的包,请告诉我。最终,我会将此图以 .png 格式导出到 Microsoft Word。谢谢你。