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


 

 


9
Leave a Reply

avatar
6 Comment threads
3 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
8 Comment authors
TseJulesKarinaKarinaHoltz Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Tse
Guest
Tse

Hey there! Thanks for this amazing piece of art! I changed the code a little bit and applied it to my data. My data is relative, meaning each bar adds up to 100%. It works pretty well, except I don’t manage to have the annotations above each bar and also, for some of the filds the color seems to be “NULL” or “white” as they are not filled by the viridis scale. I have tried several different things, yet I cannot figure out why these two bugs are happening. Would you have an idea? Do you want me to send… Read more »

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. […]