我正在寻找一种在R
中将直方图列表打印到PDF的方法。
我已经为ggplot2
图找到了很多方法,但histograms
没有。我正在使用base
直方图函数。
答案 0 :(得分:0)
对于base
图片,请使用par(mfrow=c(2,2))
。如果您使用pdf
图形输出,如果您打印的图表超过4个,它将流入新页面。
答案 1 :(得分:0)
好的,以防ggplot可以替代:
library(tidyverse)
df <- data.frame(
b = rnorm(10000)
, c = 1:10000
)
df %>%
ggplot(aes(b)) +
geom_histogram()
R Graphics Cookbook有帮助。 ;)