使两
legend
电话。一个用来画线的
bg = NA
另一个是用
bty = "n"
:
set.seed(1)
x=1:10
y=runif(10)
plot(x, y, lwd = 3, col = "black", bg = "green", pch = 21, cex = 2)
arrows(x, y-0.05, x, y+0.05, lwd = 3, col = "green", angle = 90, code = 3)
legend("topright",
col="green",
lwd = 3,
lty = 1,
legend = "text",
cex = 2,
bg = NA)
legend("topright",
col = "black",
pt.bg = "green",
pch = 21,
lwd = 3,
legend = "text",
cex = 2,
lty = 0,
bty = "n")