Solid fills
jesbrz opened this issue · comments
Certainly - although I think it is already implemented via geom_arcbar()
. Let me know if this is what you were looking for!
Sorry for delay in reply. Yes, it's a nearly perfect approach. I change sep value to 0.01 to remove the white between. Now I just have to find a way to reduce the thickness of the black lines. Thanks for your help.
I realized thanks to your post that I should account for the possibility of sep = 0
. I will fix that ASAP. The thickness of the black lines can (theoretically) be reduced with lwd
(since geom_arcbar
calls geom_polygon
). But there is a minimum width. If you want no black contours at all, you can set color = NA
. Below is the adjusted example code:
bt <- data.frame(
parties = factor(c("CDU", "CSU", "AfD", "FDP", "SPD",
"Linke", "Gruene", "Fraktionslos"),
levels = c("CDU", "CSU", "AfD", "FDP", "SPD",
"Linke", "Gruene", "Fraktionslos")),
seats = c(200, 46, 92, 80, 153, 69, 67, 2),
colors = c("black", "blue", "lightblue", "yellow", "red",
"purple", "green", "grey"),
stringsAsFactors = FALSE)
ggplot(bt) +
geom_arcbar(aes(shares = seats, r0 = 5, r1 = 10, fill = parties), color = NA, sep = 0.01) +
scale_fill_manual(values = bt$colors) +
coord_fixed() +
theme_void()
works like a charm Frederik, thanks a lot! Also color=NA works fine for me.
Glad it helped!