0

I plot a pie chart but get some questions on how to modify it. My code is

library(plotrix)
df <- c(29, 29, 36,26)
lbls <- c("Blue(29)","Gold(29)","Green(36)","Orange(26)")
labelco <- c('Blue','yellow','springgreen3','darkorange1')
pie3D(df, main="Yi Li's Color", labels=lbls, radius=0.5, 
      col = labelco ,labelrad=1.7,
      explode=0.1)

and you can get a pie chart below: pie chart I made

Is anyone can teach me: how to change label format(maybe choose Times New Roman), distance between main text and plot, and put the number on the each parts ? Thank you very much. Best Regards,

Lee Yee
  • 17
  • 1
  • 8
  • 1
    I have not come across the `plotrix` library before, so I don't know about that, but you can make all the modifications you specified if you use `ggplot2` instead. Reference: http://docs.ggplot2.org/current/coord_polar.html – ytk Jan 15 '16 at 22:11
  • Hi @Teja K, I am new R user. Can you show the code to me ? So I need how to do it for next time. Thank you much. – Lee Yee Jan 19 '16 at 17:05
  • The link I posted above shows how to build a pie chart using `ggplot2`. If you're looking for things like changing font, there are tons of resources. If you just do a google search, you will find lots of questions on stackoverflow, so it isn't very hard! – ytk Jan 19 '16 at 23:09

0 Answers0