This may be a dumb question, but I've wasted several hours trying to find an answer.... When I do a plot with no parameters set eg: ' >plot(d1)' it comes up with a dark gray background and blue data points. I can modify the data points using '>plot(d1, col = "red")', but I have not been able to modify the background color. '>plot(d1, bg = "white")' does not work. Any help would be most appreciated. Cheers, Ian.
Hi Ian, Not 100% sure on this, but I've recently been wrestling with producing plots in R and I think I know the answer to your question. As far as I could tell, all the parameters for graphics are stored using par(). There is a parameter $bg, which for me is set to "transparent", but I'll bet that for you it's set to "charcoal" or something like that :-) I would not be surprised if you could set the background of your plot to transparent with the following command: par$bg <- "transparent" HTH, Jonck> This may be a dumb question, but I've wasted several hours trying to > find an answer.... > > When I do a plot with no parameters set eg: ' >plot(d1)' it comes up > with a dark gray background and blue data points. I can modify the > data points using '>plot(d1, col = "red")', but I have not been able > to modify the background color. '>plot(d1, bg = "white")' does not > work. Any help would be most appreciated. > > Cheers, > Ian.
What is d1? The plot function itself is generic and does not necessarily do anything. It might be that the d1 object is of a particular class and the plot method for that class changes the background, point color, etc. You could try par(bg = "transparent") but it's possible that the plot method might just reset it. -roger Ian Dickie wrote:> This may be a dumb question, but I've wasted several hours trying to > find an answer.... > > When I do a plot with no parameters set eg: ' >plot(d1)' it comes up > with a dark gray background and blue data points. I can modify the data > points using '>plot(d1, col = "red")', but I have not been able to > modify the background color. '>plot(d1, bg = "white")' does not work. > Any help would be most appreciated. > > Cheers, > Ian. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >