Skip to content
Back to formatted view

Raw Message

Message-ID: <4CF64EF6.10705@ucalgary.ca>
Date: 2010-12-01T13:34:46Z
From: Peter Ehlers
Subject: how to remove grid lines from coplot graphs
In-Reply-To: <AANLkTik2sV07J3KtpLSSfyQbVnz6K9mu5YCPEHN9bxAW@mail.gmail.com>

On 2010-12-01 01:51, Seth Roberts wrote:
> coplot() usually puts grid lines in the panels it makes. To see examples,
> example(coplot).
>
> How can I remove those grid lines?
 >
 > Seth Roberts
 >

That's hard-coded in coplot. But you can easily make a
modified copy of coplot. Here are the steps:

1. make a copy of coplot; call it mycoplot.
2. add this to the argument list of the function:

    col.grid = "lightgray"

3. find this line in the code:

    grid(lty = "solid")

and change it to

    grid(lty = "solid", col = col.grid)

4. source() your new function.

It wouldn't be a bad idea to also do

    environment(mycoplot) <- environment(coplot)

Now just set col.grid = "transparent"
(or col.grid = 0 should also work) when you
want to suppress the grid. This also gives you
the option of using other grid colours.

Peter Ehlers