我能夠在這里復制另一個很好的答案來創建一個基本的徑向圖,但是任何人都可以給我任何其他函式/引數/想法的線索,了解如何將基本函式轉換為類似的東西:

uj5u.com熱心網友回復:
你可以像這樣接近:
df <- data.frame(x = c(10, 12.5, 15), y = c(1:3),
col = c("#fcfbfc", "#fbc3a0", "#ec6f4a"))
library(ggplot2)
ggplot(df, aes(x = 0, xend = x, y = y, yend = y, color = col))
geom_hline(yintercept = c(1:3), size = 14, color = "#dfdfdf")
geom_hline(yintercept = c(1:3), size = 13, color = "#f7f7f7")
geom_segment(color = "#bf2c23", size = 14, lineend = 'round')
geom_segment(size = 13, lineend = 'round')
scale_color_identity()
geom_point(aes(x = x - 0.03 * y), size = 5, color = "#bf2c23",
shape = 21, fill = 'white')
geom_point(aes(x = x - 0.03 * y), size = 2, color = "#bf2c23",
shape = 21, fill = 'white')
scale_y_continuous(limits = c(0, 4))
scale_x_continuous(limits = c(0, 20))
coord_polar()
theme_void()

uj5u.com熱心網友回復:
這是一個開始。您是否正在嘗試復制某些特定方面?這是一種相當定制的格式。
df <- data.frame(type = c("on", "ia", "n"),
radius = c(2,3,4),
value = c(10,21,22))
library(ggplot2); library(ggforce)
ggplot(df)
geom_link(aes(x = radius, xend = radius,
y = 0, yend = value),
size = 17, lineend = "round", color = "#bb353c")
geom_link(aes(x = radius, xend = radius,
y = 0, yend = value, color = type),
size = 16, lineend = "round")
geom_label(aes(radius, y = 30,
label = paste(type, ": ", value)), hjust = 1.8)
scale_x_continuous(limits = c(0,4))
scale_y_continuous(limits = c(0, 30))
scale_color_manual(values = c("on" = "#fff7f2",
"ia" = "#f8b68f",
"n" = "#e4593a"))
guides(color = "none")
coord_polar(theta = "y")
theme_void()

轉載請註明出處,本文鏈接:https://www.uj5u.com/net/483780.html
