Reputation: 173
The following simple example...
plot(c(1,2),c(1,2),type="l")
legend(1,1.5,legend="Test",lty=1,seg.len=2)
...produces the error
Error in legend(1, 1.5, legend = "Test", lty = 1, seg.len = 2) : unused argument (seg.len = 2)
How should I use seg.len
to get longer lines in legends?
Upvotes: 3
Views: 1741
Reputation: 10350
If you use this in a larger script, other packages might mask the legend()
function. These "other" functions might not contain the seg.len
parameter. Thus you have to reference to the basic legend
function. You can easily achieve this by adding the package like this:
graphics::legend(1, 1.5, legend = "Test", lty = 1, seg.len = 2)
Upvotes: 1
Reputation: 2982
The code in question works perfectly for me (see image output below).
I suggest you do the following:
Upvotes: 0