I've noticed that ggplot2 leaves a small gap between the x and the y axes.
Consider the following code:
require(ggplot2, quietly=TRUE)
axisLines = element_line(color="black", size = 2)
p= ggplot(BOD, aes(x=Time, y=demand)) + geom_line() +
theme(axis.line.x = axisLines,
axis.line.y = axisLines,
panel.background = element_blank())
p
Try changing the lineend
. lineend = "square"
seems to work
axisLines = element_line(color="black", size = 2, lineend = "square")
p= ggplot(BOD, aes(x=Time, y=demand)) + geom_line() +
theme(axis.line.x = axisLines,
axis.line.y = axisLines,
panel.background = element_blank())
p
See http://docs.ggplot2.org/0.9.3.1/geom_path.html for more on lineend