我有一个问题,就是调整绘图区域的大小。如果您查看以下示例,就会发现x轴上的标签"x"超出了绘图窗口/区域的范围,因此不再可见。我尝试使用resize函数来调整绘图窗口/区域的大小:
dev.new(width=10, height=10)
但这并不会增加实际绘图区域外的白边空间。我还将图形保存为PDF文件,希望标签“x”会重新出现在PDF中,但事实并非如此。是否有什么办法可以增加特定的区域?
library(ggplot2)
df <- data.frame(x=1:10, y=1:10)
ggplot(df, aes(x,y)) + geom_point() +
opts(axis.title.x = theme_text(size = 14, hjust = 0.5, vjust = -5))
dev.new(width=5, height=5)
能解决这个问题吗? - smilligvjust = -5
吗?如果你把它替换为vjust = -0.5
,会怎么样呢? - smilligopts(plot.margin = unit(c(2, 2, 2, 2), "cm"))
的翻译是什么? - smillig