如何删除与r图例中的符号相交的线?查阅了?legend,但似乎找不到答案。
plot.new()
legend("top",ncol=1,c("Mound reef (M)","Spur and Groove (SG)",
"Rubble Fields (RF)","Coral Walls (CW)","Mounds and rubble fields (MR)",
"Mounds, Monostand walls and Rubble (MMR)"),pch=3:8, title="Reef Types",
cex=1, lwd=2)
最佳答案
只需添加lty=NULL
plot.new()
legend("top",ncol=1,c("Mound reef (M)","Spur and Groove (SG)",
"Rubble Fields (RF)","Coral Walls (CW)",
"Mounds and rubble fields (MR)",
"Mounds, Monostand walls and Rubble (MMR)"),
pch=3:8, title="Reef Types",cex=1,lwd=2, lty=NULL)
编辑
如Josh O'Brien所指出的,删除
lwd=2
就足够了,因此,您的代码应为:plot.new()
legend("top",ncol=1,c("Mound reef (M)","Spur and Groove (SG)",
"Rubble Fields (RF)","Coral Walls (CW)",
"Mounds and rubble fields (MR)",
"Mounds, Monostand walls and Rubble (MMR)"),
pch=3:8, title="Reef Types",cex=1)
关于在R中的图例中删除符号中的线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12496093/