[Rd] Graphics, grid with type="b" causes problems (PR#2723)

Uwe Ligges ligges at statistik.uni-dortmund.de
Sat Apr 5 16:31:28 MEST 2003


wolfgang.waser at rz.hu-berlin.de wrote:
> Full_Name: Wolfgang Waser
> Version: 1.6.2
> OS: Windows98SE / SuSE Linux 8.1
> Submission from: (NULL) (141.20.60.4)
> 
> 
> Including >type="l"< or >type="b"< in plot command causes problems with grid:
> 
> .....
> layout <- par(fin=c(3.46,3.46),mai=c(0.63,0.63,0.05,0.05),mgp=c(2,0.7,0),
> 	tcl=0.35,las=1,cex.axis=0.9,cex.lab=1,ps=10)
> 
> plot(data.trout[,1],data.trout[,2],xlim=range(6.5,8.5),ylim=range(120,470),
> 	xlab="pH",ylab=expression(paste("P"[O[2]],
> 	" (Torr)")),bg="white",grid(lty=2,lwd=0.6))
> .....
> 
> This plot works fine. Note: the grid is "in the back", i.e. does not overlay
> tick marks, plot symbols or boundary lines.

This is not directly reproducible without the object "data.trout".

Where is the documentation that states something like
    plot(1:10, grid())
should work?

It works fine? From my point of view the appearance of a grid in that 
plot() instead of an error message is completely unexpected (and does 
not happen for a simple example).



> Including type="b" (or "l") causes an error message:
> 
> ...
> Error in plot.window(xlim, ylim, log, asp, ...) : 
> 	"log=" specification must be character
> ...
> 
> Including >log=""< within the plot command gets rid of the message. However, now
> the grid (light grey) overlays tick marks, lines of the plot, and boundary
> lines.

In your first call, grid(..) was mapped to the argument "type". Now, the 
next free argument name in plot.default() is "log", which your grid(..) 
statements is mapped to.

Please use grid() separately. Overplotting is expected, so you have to 
overplot again with the relevant things.

This is *not* a bug (hence no need to send a bug report!).

Uwe Ligges


> Regards
> 
> Wolfgang
> 
> ______________________________________________
> R-devel at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list