ggplot极坐标图文字被截断

时间:2016-06-19 16:21:57

标签: r text ggplot2 polar-coordinates

我正试图找到一种方法来删除使用ggplot从极坐标图上的边缘切掉的文本(参见附件)。我已经尝试使用vjust,hjust,nudge_y等在主题,文本和geom_text中进行操作。我根本无法让他们动起来。

ggplot(ds, aes(factor(TraitIds), UserDat, fill = factor(TraitIds))) + 
  geom_bar(width = 1,stat="identity") + 
  scale_y_continuous(breaks = 0:1) + 
  coord_polar() +
  geom_text_repel(nudge_y=0.3)+
  labs(x = "Raw Trait Scores", y = "") +
  theme( panel.background = element_rect(fill = "white",
                                        colour = "white",
                                        size = 0.5, linetype = "solid"),
        panel.grid.major = element_line(size = 0.1, linetype = 'solid',
                                        colour = "black"), 
        panel.grid.minor = element_line(size = 0.1, linetype = 'solid',
                                        colour = "black"),
        legend.position = "none",
        axis.text.y = element_blank(),
        text = element_text( face = "plain",
                            colour = "black", size = 10,
                            hjust = 100, vjust = 1000, angle = 0,
                            lineheight = 0.9),
        axis.ticks = element_blank())

enter image description here

0 个答案:

没有答案