3D Pie Chart

Here we are going to create a 3D Pie chart using plotrix package and then we will use pie3D() function to plot 3D plot.

R




# Get the library.
library(plotrix)
 
# Create data for the graph.
geeks <- c(23, 56, 20, 63)
labels <- c("Mumbai", "Pune", "Chennai", "Bangalore")
 
piepercent<- round(100 * geeks / sum(geeks), 1)
 
# Plot the chart.
pie3D(geeks, labels = piepercent,
    main = "City pie chart", col = rainbow(length(geeks)))
legend("topright", c("Mumbai", "Pune", "Chennai", "Bangalore"),
                    cex = 0.5, fill = rainbow(length(geeks)))


Output:

R – Pie Charts

 



R – Pie Charts

A pie chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportions. It depicts a special chart that uses “pie slices”, where each sector shows the relative sizes of data. A circular chart cuts in the form of radii into segments describing relative frequencies or magnitude also known as a circle graph. 

Similar Reads

R – Pie Charts

R Programming Language uses the function pie() to create pie charts. It takes positive numbers as a vector input....

Add pie chart color palettes

...

3D Pie Chart

...