Attempting to create pie chart with ggplot2 but cannot seem to get it using other references online. The chart I create is missing most of its fill.
ggplot(sae,aes(x=1,fill=factor(State), width=1))+
geom_bar()+
ggtitle("House by State")+
coord_polar(theta='y')
This code gives:
How do I fill the center?
Any other improvements appreciated.
As @Heroka already mentioned in the comments, pie-charts are a bad way of visualizing information. They are bad that it is even mentioned in the help-files of R.
From
?pie
:Some further reading on the pie-chart debate.
With the example data of @Heroka:
you get:
A clear demonstration that it's better to see the differences between the categories when you use a barchart instead of a piechart.
With sample data
EDIT: Other options (because piecharts are bad)
When you want to show information about proportions, there is another choice, the waffle package which gets back more to what you probably intend to show with a pie chart (i.e., proportions). In most instances, the bar plots above would likely be best, but for the sake of showing another way of plotting...
Using the
sae
data from above:which yields this: