使用以下代码:
cars <- c(1, 3, 6, 4, 9)
trucks <- c(2, 5, 4, 5, 12)
g_range <- range(0, cars, trucks)
plot(cars, type="o", col="blue", ylim=g_range, axes=FALSE, ann=FALSE)
legend(1, g_range[2], c("cars","trucks"), cex=0.8, col=c("blue","red"), pch=21:22, lty=1:2);
如何修改代码,使图例标记(即-o-和-box-符号)放在相应名称的 右侧 侧?