0
我試圖用R繪製餅圖。如何將以下餅圖組合成一個圖?將兩個圖組合成一個圖
data <- c(632,20,491,991,20)
names <- c("alpha","beta","gamma","delta","omega")
pie(data, names,col = c("red", "yellow", "blue", "green", "cyan"),
main="PIE CHART 1")
data <- c(37376,41770,5210,5005,3947)
names <- c("alpha","beta","gamma","delta","omega")
pie(data, names,col = c("red", "yellow", "blue", "green", "cyan"),
main="PIE CHART 2")
可以設置'帕(mfrow = C(1,2))'繪製在一起。這是一個全局選項,所以要關閉它,你必須再次寫入'par(mfrow = c(1,1))'。 – Marta
創建餅圖通常是不明智的,特別是如果您的類別具有相似的比例。直方圖和條形圖是更好的可視化工具。 – landau