如果在ggplot中指定軸限制,則將刪除偏遠(yuǎn)點。這對點很好,但是您可能希望繪制與指定范圍相交的線,但是ggplot range或xlim/ylim方法會刪除這些線。還有另一種方法可以指定繪圖軸范圍而不刪除外圍數(shù)據(jù)嗎?例如require(ggplot2)d = data.frame(x=c(1,4,7,2,9,7), y=c(2,5,4,10,5,3), grp=c('a','a','b','b','c','c'))ggplot(d, aes(x, y, group=grp)) + geom_line()ggplot(d, aes(x, y, group=grp)) + geom_line() + scale_y_continuous(limits=c(0,7))ggplot(d, aes(x, y, group=grp)) + geom_line() + ylim(0,7)
- 2 回答
- 0 關(guān)注
- 741 瀏覽
添加回答
舉報
0/150
提交
取消