假设我有这个df,我用ggplot创建了一个图
df = data.frame(x = 1:10,
y = -10,1)
df
library(ggplot2)
ggplot(df)+aes(x=x,y=y)+
theme_classic()+
scale_x_continuous(breaks = 0:10,limits=c(0,10))+
scale_y_continuous(breaks = -10:0,limits=c(-10,0) )
我希望标签0(x轴)和-10(y轴)位于x轴和y轴的交点上
1条答案
按热度按时间krcsximq1#
我通常做的是将
expand = c(0,0)
添加到scale_x/y_continuous
-它将是: