R 正在绘制页面之外的标签
我正在运行以下命令:
png(filename="figure.png", width=900, bg="white")
barplot(c(1.1, 0.8, 0.7), horiz=TRUE, border="blue", axes=FALSE, col="darkblue")
axis(2, at=1:3, lab=c("elephant", "hippo", "snorkel"), las=1, cex.axis=1.3)
dev.off()
左侧的标签出现在页面之外。我似乎不知道如何解决它。有什么想法吗?
i'm running the following:
png(filename="figure.png", width=900, bg="white")
barplot(c(1.1, 0.8, 0.7), horiz=TRUE, border="blue", axes=FALSE, col="darkblue")
axis(2, at=1:3, lab=c("elephant", "hippo", "snorkel"), las=1, cex.axis=1.3)
dev.off()
and the labels on the left are appearing off the page. I can't seem to figure out how to fix it. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您没有在左边距中为那么长的标签留出足够的空间。尝试:
“par”的“mar”参数按以下顺序设置边距宽度:“底部”、“左侧”、“顶部”、“右侧”。默认设置 'left' 为 4,这里我将其更改为 6。
You haven't left enough space in the left margin for labels that long. Try:
The 'mar' argument of 'par' sets the width of the margins in the order: 'bottom', 'left', 'top', 'right'. The default is to set 'left' to 4, here I have changed it to 6.