I am plotting a time series with mean values of a response variable as points (y-axis) by month (x-axis).
Values lying on the x-axis (i.e. 0 values) are clipped. I can change the limits of the y-axis to include some padding below 0, but I prefer not to.
Is there a way to plot these 0 points in front of, or on-top of the x-axis?
If you were using base graphics you could use clip().
Try this,
With the release of ggplot2 version 3.0.0, you can simply use
coord_cartesian(clip = 'off')
.If you're using one of the less commonly-used
coord_*
systems or functions (e.g.coord_polar
orcoord_flip
), then you can use theclip = 'off'
argument there, too.You can use attribute expand() on the scale_y
Exemple for 10% each side of y scale :