[英]Histogram not showing all x-axis labels in R
嘗試使用breaks
參數添加scale_x_continuous
:
ggplot(...) +
... +
scale_x_continuous(breaks = 1995:2016)
你可以試試:
ggplot(video_games, aes(x = year)) +
geom_bar() +
scale_x_continuous(breaks = unique(video_games$year)) +
coord_flip()
coord_flip
在那里,因為您將在 x 軸上有很多“長”標簽。 如果你不想翻轉,你可以旋轉:
theme(axis.text.x = element_text(angle = 90, vjust = 0.5))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.