I got a circular 360 degree bar plot in which I manually need to specify the angle of each bar (numeric x-axis). In general the plotting works fine besides for a datapoint having an angle of 0 resp. 360 degree. This row is removed and not plotted, not even with a bar width of 1.
Why is that and how can a bar with a center value of 0 and a bar width of e.g. 20 be drawn (from -10 resp. 350 degree to 10 degree)?
Thanks!
MWE:
library(tidyverse)
# dummy data
data <- data.frame(
variable = c(0, 90, 180, 270),
value = c(50, 100, 150, 200))
# plot
ggplot(data, aes(x = variable, y = value, fill = factor(variable))) +
geom_col(width = 20) + # Even with a widh of 1 the first datapoint is removed from the plot.
scale_x_continuous(breaks = seq(from=0, to=359, by=10), limits=c(0, 360)) +
coord_polar(start = 0)
