我产生ECDF情节,想一个传奇添加到它,但得到以下错误:如何将图例添加到ecdf图?
plot(xlim=c(0,100), ylim=c(0,1), main=NULL, xaxs="i", yaxs="i",
ecdf(PrecentageVector1), col="red", do.p = FALSE, pch=19,
lwd=3, legend("bottomleft",c("A","B","C")), panel.first = grid())
Error in strwidth(legend, units = "user", cex = cex, font = text.font) :
invalid graphics state
可能是什么问题呢?
我不承认错误,无法重现,因为你没有给我们'PrecentageVector1'(原文如此)。一般来说,在'plot()'后面调用'legend()'' –