Share the Gallery !Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone





This page follows the chart #314 that explained the basis of circle packing. We use the awesome ggraph library, and this page describes how to custom colour, size and others.


The first step is to map a feature of each circle to a specific size. This is quite straightforward using the ‘weight’ argument in the ggraph call:




Now, we definitely need to add color to the chart. The first option is to map color to depth: the origin of every node will have a color, the level 1 another one and so one. As usual, you can play with the colour palette to fit your needs. Here are 2 examples with the viridis and the RColorBrewer palettes:



To add more insight to the plot, we often need to add labels to the circles. However you can do it only if the number of circle is not to big. Note that you can use geom_node_text (left) or geom_node_label to annotate leaves of the circle packing:






Make a search



Leave a Reply

Be the First to Comment!

Notify of