plot(donnees.test$y,esvr1.pred,xlab = "Predicted Vlues", ylab = "Actual Values",type="p", yaxs="i",ylim=c(2,18),xaxs="i",xlim=c(2,18))
points(donnees.test$y,esvr1.pred, col=1,pch =19)
points(donnees.test$y,esvr1.pred, col=2,pch =20)
points(donnees.test$y,ANFIS, col=6,pch =3)
points(donnees.test$y,NN, col=4,pch =4)
#points(donnees.test$y,esvr1.pred, col=3)
abline(a = 0, b = 1, col = 3)
abline(a = 0, b = 1.25, col = 2)
text(9,14, "+25% Line", col = 2, adj = c(-.1, -.1))
abline(a = 0, b = 0.75, col = 2)
text(14.2,10, "-25% Line", col = 2, adj = c(-.1, -.1))
leg.txt <- c("SVR_rbf", "SVR_poly","ANFIS","NN")
legend(list(x = 2,y = 17.95), legend = leg.txt, col = 1:6, pch = c(19,20,3,4))
我改变了我想要的ANFIS的颜色,但在标签表中,ANFIS的颜色没有改变。我该怎么改变它? 如果我想在绘图选项卡上添加一些文本,我应该在源代码中添加哪些代码?
答案 0 :(得分:0)
要为地块添加标题,请使用参数
main="the title here"
在plot命令中,或者如果你之后添加它,请使用
title("the title here").
图例中颜色的问题在于图例中有四个项目:
("SVR_rbf", "SVR_poly","ANFIS","NN"),
但你给的是六种颜色的情节命令:
col = 1:6.
尝试
col=1:4
代替。