[R] background color for plotting symbols in 'matplot'

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Jan 19 12:06:24 CET 2005


joerg van den hoff wrote:

> something like
> 
> 
> matplot2(matrix(1:6,3,2),matrix(7:12,3,2),pch=21,bg=c(2,3),type='b')

Where can we find "matplot2"?


> does not yield the expected (at least by me) result: only the points on 
> the first line get (successively) background colors for the plotting 
> symbols, the second line gets no background color at all for its 
> plotting symbols.
> 
> I think the natural behaviour should be two curves which (for the 
> example given above) symbol-background colors 2 and 3, respectively (as 
> would be obtained by a suitable manual combination of 'plot' and 
> 'lines'). the modification of the matplot code to achieve this behaviour 
> is obvious as far as I can see (adding 'bg' to the explicit arguments of 
> matplot and handling similar to 'lty', 'cex' and the like inside the 
> function including transfer to 'plot' and 'lines' argument list).
> 
> 
> is the present behaviour a bug of 'matplot' or is it for some reason 
> intended behaviour?

The real point is that you might want to mark by rows *or* by columns, 
so it's not that easy to specify a sensible default behaviour, at least 
one has to think about it.

If you want to implement it for all possible arguments, the well known 
problem of huge number of arguments springs to mind as well.

Since you say the "modification [...] is obvious": I think R-core 
welcomes your contribution.

Uwe Ligges



> 
> regards,
> 
> joerg
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list