A circular barplot is a barplot where bars are displayed along a circle instead of a line. This page aims to teach you how to make a grouped and stacked circular barplot. I highly recommend to visit graph #295, #296 and #297 Before diving into this code, which is a bit rough.

I tried to add as many comments as possible in the code, and thus hope that the method is understandable. If it is not, please comment and ask supplementary explanations.

You first need to understand how to make a stacked barplot with ggplot2. Then understand how to properly add labels, calculating the good angles, flipping them if necessary, and adjusting their position. The trickiest part is probably the one allowing to add space between each group.

 

 

 

Related


 

Make a search


 

 


8
Leave a Reply

avatar
5 Comment threads
3 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
7 Comment authors
JulesKarinaKarinaHoltzKarina Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jules
Guest
Jules

Hello, this is a nice data viz !
However it seems that Mister 10 is placed before Mister 2 in the A group. I guess this is because these names are treated as characters, so 10 si before 2…
Could you give an advice on that point ?
Thanks in advance !

Karina
Guest
Karina

May I ask another question? Do you have a suggestion for how to order the stacked barplot per group just like in graph #297 (based on the values in one or more of the bars)? I cant find a solution. Thanks a lot!

Karina
Guest
Karina

Thanks a lot for this beautiful graph. Is there any way to create bars that remain of the same width over the entire length, just like in a bar chart (so that the result would be more of a star than a pie). In my smaller sample, the stacks at the center look much smaller than the ones on top, although they are all of equal importance. Help would be much appreciated!

trackback

[…] This week, I will be analysing the associations between the most-frequently used words, and to researching best methods for displaying these relationships in a simple, informative graphic.  One promising candidate to explore is the circular stacked barplot. […]

Anonymous
Guest
Anonymous

Do you know how to display the fill description? To show what the different colors represent.

Peter Schaarschmidt
Guest
Peter Schaarschmidt

inside the theme() function, there is legend.position=”none” -change this to “right” to set the legend on the right, or for what I believe to be a better looking chart, set legend.position=c(0.5,0.5), this adds the legend in the middle of the circle.