Я следил за кодом из этот пост, но у меня он не работает. Вот мой код и скриншот ниже. Не могли бы вы помочь мне отцентрировать этикетку с интервалом прямо над полосой?
p <- ggplot(data=mrc, aes(x = Year, y = Total, fill = Year)) +
geom_bar(stat="identity", position = "dodge") +
geom_text(
aes(x = Year, y = Total, label = Total),
position = position_dodge(width = 1),
vjust = -0.5, size = 3
) +
theme_bw() +
scale_fill_manual(values = c("#115740","#B9975B","#D0D3D4","#F0B323")) +
theme(axis.title.x=element_blank(),
axis.title.y=element_blank(),
legend.position = "none",
plot.title = element_text(hjust = 0.5, face = "bold", colour = "#B9975B")) +
ggtitle("Petitions")
ggplotly(p)
mrc
), чтобы сделать их воспроизводимыми - person Tung   schedule 03.07.2019geom_col()
вместоgeom_bar(stat="identity", position = "dodge")
и опуская аргументposition =
дляgeom_text
. - person neilfws   schedule 03.07.2019