If you know the range of the data in your plot, you can calculate the "true" x and y limits using the fact that ggplot
using an additive expansion factor of 0.05 by default, so that the extents of the graph extend just slightly beyond the actual data values.
You can specify and multiplicative and additive expansion factor when specifying scales using expand = c(mult, add)
where mult
is the multiplicative factor and so on. So the default setting is expand = c(0,0.05)
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…