这是数据:
structure(list(SAPvsSH = c(-23.8789646372585, NaN, -10.8009305417082,
-11.8411770633881, -19.000246852629, -14.364572544966, -21.8175372410621,
-25.4455825234135, -16.3659714913407, -24.2952691912406, -0.794961013892774,
9.27790872080566, -20.9411764705882, -20.3132576468705, -25.1353910061732,
-17.0200414318061), Tooth = c("UI1", "LI1", "UI2", "LI2", "UC",
"LC", "UP3", "LP3", "UP4", "LP4", "UM1", "LM1", "UM2", "LM2",
"UM3", "LM3")), .Names = c("error", "Tooth"), class = "data.frame", row.names = c("UI1",
"LI1", "UI2", "LI2", "UC", "LC", "UP3", "LP3", "UP4", "LP4",
"UM1", "LM1", "UM2", "LM2", "UM3", "LM3"))
我使用coord_polar()
中的ggplot
生成雷达图。这是代码:
ggplot(data=dataset, aes(x=Tooth, y=error)) +
geom_point(size=1.5) +
geom_line() +
geom_hline(aes(yintercept=0), lwd=1, lty=2) +
geom_area(alpha=0.2, position = position_identity()) +
coord_polar() +
theme_bw()
我得到这样的东西: