我正在尝试覆盖x轴刻度线,但没有任何改变。如何更改x轴使其从0到45?
这是我尝试过的:
library('ggplot2')
ggplot(data = diamonds, mapping = aes(y = carat, x = price)) +
geom_line() +
theme(axis.text.x=element_text(seq(0:45)))
此外:
ggplot(data = diamonds, mapping = aes(y = carat, x = price)) +
geom_line() + scale_x_continuous(breaks = 0:45, labels = seq(0,45))
答案 0 :(得分:2)