Hmm… Interesting, I'm seeing the same thing. For similicity's sake, I think the exact replication of the example using linejoin = "mitre" from the example is probably most useful to show. I'm also going to use reprex to show the problem (always a good way to go):
# Control line join parameters
df <- data.frame(x = 1:3, y = c(4, 1, 9))
base <- ggplot(df, aes(x, y))
base + geom_path(size = 10, linejoin = "mitre", lineend = "butt")
Created on 2018-01-13 by the reprex package (v0.1.1.9000).
And the example with the same code from the docs:
Bonus forensic investigation : I checked out the ggplot2 repo, and looked for issues mentioning
mitre or linejoin. The most recent was 2014, however, the pull request that closed it wasn't long ago. Then I looked for the most recent mention of linejoin in NEWS.md (4 years ago), searched for "linejoin", found somewhat recent changes for linejoin in
geom_segment.R, but, this was in
geom_path(). However, that doesn't necessarily mean they're unrelated.
I could probably investigate further, but, I think it makes sense to open an issue.