我正在尝试调整绘图以适应我的文档,但是我很难将绘制的图表做成正方形.
例:
pdf(file = "./out.pdf", width = 5, height = 5)
p <- ggplot(mydata, aes(x = col1, y = col2))
print(p)
aux <- dev.off()
Run Code Online (Sandbox Code Playgroud)
虽然x和y的限制是相同的,但结果中的图不是方形的.我猜R使封闭面板5x5"但不关心实际的图表大小.
我怎样才能解开图表?