[英]How to scale a bar plot using ggplot2?
我希望我的栏 plot 占用更少的空间,目前有很多不必要的空白。 我希望垃圾箱比现在更近。 由于 X 轴上只有两个类别,我不明白为什么它们之间有这么多空间。 - 增加 bin 宽度会使空白 go 消失,但随后 bin 变得异常大。
代码:
# Creates plot to show response-rate
hubspot_ordering %>%
ggplot(aes(x = Replied)) +
geom_bar(color = "black",
fill = "steelblue",
stat = "count",
width = 0.1,
position = position_dodge(0.9)) +
xlab("Kommuners respons på e-post og oppringing") +
scale_x_discrete(labels = c("Besvart",
"Ingen respons")) +
ylab("Antall kommuner") +
theme(element_line(size = 0.5)) +
theme_bw() -> plot_response_rate
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.