我使用ggplot2
库和RStudio中的qplot()
函数创建了一个简单的散点图。
问题是我创建绘图时标签会重叠。
我不想删除标签。我的意思是扩大纸张尺寸,但我似乎无法找到办法。任何帮助将不胜感激。
wordcloud
库作为替代方案进行了调查,但遇到了同样的问题。scale_x_continuous(expand = c(.3, .3))
命令进行了调查,该命令允许我扩展工作表以解决边缘问题,但我希望看看是否存在更好的解决方案。ggplot2
手册页,但未能找到干净的解决方案。我觉得是时候寻求一些帮助和一些解决方案的指示。如果我找到解决方案,我会发布它。
library(ggplot2)
library(grid)
td3 <- read.csv("td3.csv")
p <-qplot(X,Y, xaxs = "i", yaxs = "r", las = 1, data=td3, shape=as.factor(Type), label=Identifier, asp = 1)
p <- p + scale_x_continuous(expand = c(.3, .3))
p + geom_text(aes(colour=factor(Type)), angle = 30, size=4, hjust=-0.1, panel.margin = unit(50, "lines"))
Identifier,X,Y,,Type
1st Reference Long Title,5,280,,Super fit
2nd Reference Long Title,1,60,,fit
3rd Reference Long Title,1,60,,fit
4th Reference Long Title,3,100,,fit
5th Reference Long Title,1,14,,unfit
6th Reference Long Title,1,48,,fit
7th Reference Long Title,1,48,,fit
8th Reference Long Title,10,80,,fit
9th Reference Long Title,1,24,,unfit
10th Reference Long Title,1,80,,fit
11th Reference Long Title,1,36,,unfit
12th Reference Long Title,1,10,,unfit
13th Reference Long Title,3,60,,fit
14th Reference Long Title,3,120,,fit
15th Reference Long Title,3,80,,fit
16th Reference Long Title,10,400,,Super fit
17th Reference Long Title,5,360,,Super fit
18th Reference Long Title,2,5,,unfit
答案 0 :(得分:0)
您可以在发出绘图命令之前“增加画布大小”,例如参见?png
或?jpg
。
或者,您可以使用ggsave
,请参阅R plot: size and resolution