Data Science, Data Visualization, R.
mutate(running=cumsum(total_pop), pos=running - total_pop/2) So sunburst_2 should be sunburst_2 = sunburst_1 + geom_bar(data=secondLevel, aes(x=2, y=total_pop, fill=total_pop, stroke=3), color='white', position='stack', stat='identity') sunburst_2_text = sunburst_2 + geom_text(data=secondLevel,