How to draw pie chart with ggforce package in R language
This article will explain in detail how to use the R language ggforce to draw a pie chart. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Image.png
Recently, I have been reading the paper. Phased diploid genome assemblies and pan-genomes provide insights into the genetic history of apple domestication's notes today record the drawing of the pie chart in the Figure2 diagram b in the paper.
Image.png
Ggplot2 jigsaw puzzle I personally think is relatively troublesome, and to achieve the above picture of the various parts can be separated seems to be difficult to achieve. When I was looking for the information of the pie chart, I found the ggforce package. It is relatively convenient to use it to make the pie chart. Today's content is mainly realized by the functions in this package.
The first step is to prepare the data
The data only needs two columns.
The first time you use the ggforce package, you still need to install install.packages ("ggforce")
The basic pie chart code is as follows: df1