強制原點從0開始如何在ggplot 2中設(shè)置y軸和x軸的起源/攔截?x軸的線應該正好在y=Z.帶著Z=0或者另一個給定的價值。
2 回答

守著星空守著你
TA貢獻1799條經(jīng)驗 獲得超8個贊
xlim
ylim
expand_limits
, scale_x_continuous
scale_y_continuous
df <- data.frame(x = 1:5, y = 1:5)p <- ggplot(df, aes(x, y)) + geom_point()p <- p + expand_limits(x = 0, y = 0)p # not what you are looking for
p + scale_x_continuous(expand = c(0, 0)) + scale_y_continuous(expand = c(0, 0))
x = 5
y = 5
.
- 2 回答
- 0 關(guān)注
- 870 瀏覽
添加回答
舉報
0/150
提交
取消