0

有人对此图有解决方案吗?条形图上方的标签在顶部或底部被截断,具体取决于我如何进行垂直调整。我认为我不能将字体减小到足以适应和可读的程度。

一方面,我有这个,其中标签在付费搜索的第一个栏中被切断

在此处输入图像描述

ggplot(all_rb6, aes(x = `Number of Touchpoints`, y = Percent, fill = Campaign)) +
  geom_col(position = 'dodge') +
  facet_wrap(~Campaign) +
    labs(title="Title", subtitle = "subtitle") +
  theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
  theme(plot.subtitle = element_text(hjust = 0.5)) +
  labs(caption = "Marketing") +
  geom_text(aes(label = paste(format(Percent), "%")), vjust = -0.5, position = position_dodge(.9), colour = "black") +
  scale_fill_brewer(palette = "Pastel1")

另一方面,我有这张图,其中所有标签中第三条的标签都被切断了。

强文本

ggplot(all_rb6, aes(x = `Number of Touchpoints`, y = Percent, fill = Campaign)) +
  geom_col(position = 'dodge') +
  facet_wrap(~Campaign) +
    labs(title="Title", subtitle = "subtitle") +
  theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
  theme(plot.subtitle = element_text(hjust = 0.5)) +
  labs(caption = "Marketing") +
  geom_text(aes(label = paste(format(Percent), "%")), vjust = 1.5, position = position_dodge(.9), colour = "black") +
  scale_fill_brewer(palette = "Pastel1")
4

0 回答 0