Description
This is an issue that has been discussed over at Stackoverflow. The original problem can be found here. A minimal reprex is included below.
I have the following data frame:
# Dummy data frame
df <- expand.grid(x = 1:3, y = 1:3)
I would like to plot it as a geom_tile
using ggplot2
like so:
# Tile plot
ggplot(df) +
geom_tile(aes(x = x, y = y),
fill = NA, colour = "red", size = 3, width = 0.7, height = 0.7)
which gives,
Notice that in the top left corner of each tile the border has a notch missing and that the corner doesn't dovetail nicely like the other corners. The outcome I expected was a square around each tile, perhaps something like this:
A solution offered here by Z. Lin in that Stackoverflow thread suggests that linejoin
and lineend
for geom_tile
are switched to mitre
and square
, respectively. Or, that they are at least offered as parameters in the geom
so that the user can choose for themselves. Hopefully, this demonstrates my issue adequately, but please let me know if I can clarify any aspect.