【发布时间】:2018-02-13 09:49:17
【问题描述】:
这是我的数据。
Mod <- as.factor(c(rep("GLM",5),rep("MLP",5),rep("RF",5),rep("SVML",5),rep("SVMR",5)))
Manifold <- as.factor(rep(c("LLE","Iso","PCA","MDS","kPCA"),5))
ROC <- runif(25,0,1)
Sens <- runif(25,0,1)
Spec <- runif(25,0,1)
df <- data.frame("Mod"= Mod, "Manifold"= Manifold, "ROC" = ROC, "Sens" = sens, "Spec" = spec)
我正在制作这张图表
resul3 <- ggplot(df, aes(x = Mod, y = ROC, fill= Manifold)) +
geom_bar(stat = "identity", position = "dodge", color = "black") +
ylab("ROC & Specificity") +
xlab("Classifiers") +
theme_bw() +
ggtitle("Classifiers' ROC per Feature Extraction Plasma") +
geom_point(aes(y=Spec), color = "black", position=position_dodge(.9)) +
scale_fill_manual(name = "Feature \nExtraction", values = c("#FFEFCA",
"#EDA16A" ,"#C83741", "#6C283D", "#62BF94"))
而我想要的是另一个标题为“特异性”和一个黑点的传奇。我不希望这一点出现在 Manifolds 传说中。
Something like this but without the points inside the manifold squares
【问题讨论】:
-
将
color放入geom_point的aes()以创建第二个图例。 -
我猜他想彻底摆脱传说中的点点滴滴。
-
他说他想要
another legend with tittle (sic) "Specificity" and a single black point。所以你的答案部分正确,但你需要将第二个图例添加到geom_point的aes。