[R] Can one set box line width within the matplot command?

Marc Schwartz marc_schwartz at comcast.net
Mon Mar 12 18:50:22 CET 2007


On Mon, 2007-03-12 at 11:01 -0600, Ben Fairbank wrote:
> Hello R users --
> 
>  
> 
> I am using matplot to prepare graphs and cannot find a way to use (for
> example) box(lwd=3) within the matplot command and instead have been
> setting the box line width after drawing the graph, by using box(lwd =
> 3).  Looking over the ?par options and the matplot() help I do not see a
> way to set box width within matplot.  Is there such an option?
> 
>  
> 
> Thanks for suggestions,

Try this:

 par(lwd = 3)
 matplot((-4:5)^2, main = "Quadratic", type = "l")

It's not any better than calling box(lwd = 3) after the plot, but is an
alternative. It may actually be worse as in some types of plots,
par("lwd") may affect some symbols.

matplot() calls plot() internally. In plot.default(), there is a
localBox() function used internally to draw the box if 'frame.plot =
TRUE'.  However, using 'lwd' as a function argument is not honored.

HTH,

Marc Schwartz



More information about the R-help mailing list