0

Sorry for my english. I want to make a pie chart. But i don't know if it's necessary to inckude width in geom_bar.

Supose any database

ggplot(aes(x = "", y = porcentaje, fill = treat)) +
geom_bar(width = 1, stat = "identity", color = "white") +
coord_polar("y", start = 0)

But if i try with: (or even if i don't include it)

ggplot(aes(x = "", y = porcentaje, fill = gender)) +
geom_bar(width = 999, stat = "identity", color = "white") +
coord_polar("y", start = 0)

The output is the same. Is it important to include it? THANKS

scalamardo
  • 27
  • 3
  • 2
    Welcome to SO vicented. If it is only `pie` chart you want, you don't need the `geom_bar` line. Read [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to as a question with a reproducible example so it'll be easier for others to help you. – deepseefan Oct 31 '19 at 04:07
  • Oh, i will read it. Thanks for the answer! but, do you know if i need to include it? I'm in a course and the teacher taught it that way, with "width=" – scalamardo Oct 31 '19 at 04:24
  • 2
    Sorry @deepseefan, but that is not right. Without a layer (i.e. geom or stat) there will be no data displayed in poor vicented's plot. He'll need his `geom_bar` (or `geom_col` if he wants to save some key strokes). You should be fine without defining `width` though. It will just change some of the axis labels. – Axeman Oct 31 '19 at 04:28

0 Answers0