0

In excel, there are tons of different ways to give a very professional look to pie charts, like shadowing, a bit of radial colors (as shown in the following image):

enter image description here

However in R I don't seem to find options to try to customise a pie chart, as you all know this is the standard way in R. Maybe a better option exists in ggplot2?

df <- data.frame(
  group = c("Male", "Female", "Car"),
  value = c(27, 23, 50),
  explanation <- c("Male: 27%", "Female: 23%", "Car: 50%")
  )
bp<- ggplot(df, aes(x="", y=value, fill=explanation))+
geom_bar(width = 1, stat = "identity")
bp
pie <- bp + coord_polar("y", start=0)
pie + theme_minimal() + theme( panel.grid = element_blank(),
                                      axis.ticks = element_blank(),
                                      axis.title.x = element_blank(),
                                      panel.border = element_blank(),
                                      axis.title.y = element_blank(),
                               axis.text = element_blank(),)
JK Lambert
  • 333
  • 1
  • 6
  • 4
    Shadows and 3D effects can disturb our perception on the displayed percentages quite much. I do not think this is professional. Computer screens and paper are inherently two dimensional and we do not need to simulate a third dimension in pie charts. If you really want this you can take a look at https://www.tylermw.com/3d-ggplots-with-rayshader/ – danlooo Sep 08 '21 at 08:43
  • 1
    Does this answer your question? [beautiful Pie Charts with R](https://stackoverflow.com/questions/33594642/beautiful-pie-charts-with-r) – hisspott Sep 08 '21 at 08:46
  • not really, I would like somehting like adding shadows, the charts in that post look still kinda simple – JK Lambert Sep 08 '21 at 10:39
  • The only package I can think of that comes close is ggfx. It just has inner/outer glow and drop shadows for making adjacent effect, but none of these specious effects excel endows its users with. – teunbrand Sep 08 '21 at 11:20

0 Answers0