Get the App
SLTechnology News&Howtos  ›  Development  › 

How to draw fan chart in R language

Shulou Source: shulou.com Published: 2022-06-01 07:26:07 10月02日 Update

The knowledge points of this article "how to draw a fan in R language" are not quite understood by most people, so the editor summarizes the following contents to you. The content is detailed, the steps are clear, and it has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to draw a fan in R language" article.

Plotrix package fan.plot draws a fan diagram

In R language, the pie chart can be completed by pie () function or drawn by ggplot2 package histogram through the change of polar coordinates.

The pie chart is composed of each fan, how to superimpose each sector into a combined overlapping fan chart? You can use the fan.plot function in the plotrxi package

Take dat data as an example:

Dat type Num1 A 902 B 343 C 564 D 995 E 15

The fan chart drawn with fan.plot is as follows:

> library (plotrix) > fan.plot (dat$Num,labels = as.character (dat$type))

Color control can be based on the parameter col, or other parameters can be adjusted to adjust the details of the picture.

> fan.plot (dat$Num,labels = as.character (dat$type), col = c ("pink", "red", "green", "grey", "blue")) the above is about "how to draw a fan chart in R language". I believe you all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about it, please follow the industry information channel.

Tags: Fan content language function parameter article knowledge article value picture most that is data more polar coordinates steps knowledge points details industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft Apple MariaDB Redmi