Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to draw pie chart with ggforce package in R language

Shulou Source: shulou.com Published: 2022-06-01 22:05:19 10月01日 Update

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

Tags: Content function language legend data article more knowledge article paper or reference yes next picture above personal code role key method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Tech Info Docker Apple Shulou Information