SyntaxFix
Write A Post
Hire A Developer
Questions
Use option bty = "n" in legend to remove the box around the legend. For example:
bty = "n"
legend
legend(1, 5, "This legend text should not be disturbed by the dotted grey lines,\nbut the plotted dots should still be visible", bty = "n")