How to change the legend box width when plotting in R
<p><a href="https://i.stack.imgur.com/qg81p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qg81p.png" alt="enter image description here"></a></p>

<p>I use the following script to generate a legend in R. But the legend box is too small... how do I increase the box width?</p>

<pre><code>legend("topleft", lty = 1, legend = c("Sub_metering_1","Sub_metering_2","Sub_metering_3"),col = c("black","red","blue"))
</code></pre>