yaxs Causes Boundary Line Colour to Change

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

yaxs Causes Boundary Line Colour to Change

Dario Strbenac-2
Why is the bottom boundary plotted in a different colour to the other three sides ?

set.seed(4444)
data <- rpois(10, 2)
plot(density(data), ann = FALSE, yaxs = 'i') # Grey bottom boundary.
plot(density(data), ann = FALSE) # All boundaries are black.

Ideally, there would be black lines on all four sides. The documentation doesn't say the colour will change.

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-unknown-linux-gnu (64-bit)

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: yaxs Causes Boundary Line Colour to Change

Sarah Goslee
I can't reproduce this on R 3.1.0 on linux or R 3.1.1 on Mac, using
the default graphics device on each.

What graphics device are you using?

If all else fails, you could use box() to draw over it.

Sarah

On Mon, Aug 25, 2014 at 8:00 AM, Dario Strbenac
<[hidden email]> wrote:

> Why is the bottom boundary plotted in a different colour to the other three sides ?
>
> set.seed(4444)
> data <- rpois(10, 2)
> plot(density(data), ann = FALSE, yaxs = 'i') # Grey bottom boundary.
> plot(density(data), ann = FALSE) # All boundaries are black.
>
> Ideally, there would be black lines on all four sides. The documentation doesn't say the colour will change.
>
>> sessionInfo()
> R version 3.1.1 (2014-07-10)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> --------------------------------------
> Dario Strbenac
> PhD Student
> University of Sydney
> Camperdown NSW 2050
> Australia
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: yaxs Causes Boundary Line Colour to Change

William Dunlap
In reply to this post by Dario Strbenac-2
Add zero.line=FALSE to the call to plot() to get rid of the gray line.
help(plot.density) should say something about it.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Aug 25, 2014 at 5:00 AM, Dario Strbenac
<[hidden email]> wrote:

> Why is the bottom boundary plotted in a different colour to the other three sides ?
>
> set.seed(4444)
> data <- rpois(10, 2)
> plot(density(data), ann = FALSE, yaxs = 'i') # Grey bottom boundary.
> plot(density(data), ann = FALSE) # All boundaries are black.
>
> Ideally, there would be black lines on all four sides. The documentation doesn't say the colour will change.
>
>> sessionInfo()
> R version 3.1.1 (2014-07-10)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> --------------------------------------
> Dario Strbenac
> PhD Student
> University of Sydney
> Camperdown NSW 2050
> Australia
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: yaxs Causes Boundary Line Colour to Change

Martin Maechler
>>>>> William Dunlap <[hidden email]>
>>>>>     on Mon, 25 Aug 2014 08:01:39 -0700 writes:

    > Add zero.line=FALSE to the call to plot() to get rid of
    > the gray line.  

Thank you, Bill.

    > help(plot.density) should say something about it.

    >  Bill Dunlap TIBCO Software wdunlap tibco.com

But it does already... I assume you mean it should say *more*
than now.  I'm open for adding a bit more and thankful for
wording suggestions (off line probably).

Martin Maechler,
ETH Zurich



    > On Mon, Aug 25, 2014 at 5:00 AM, Dario Strbenac
    > <[hidden email]> wrote:
    >> Why is the bottom boundary plotted in a different colour
    >> to the other three sides ?
    >>
    >> set.seed(4444) data <- rpois(10, 2) plot(density(data),
    >> ann = FALSE, yaxs = 'i') # Grey bottom boundary.
    >> plot(density(data), ann = FALSE) # All boundaries are
    >> black.
    >>
    >> Ideally, there would be black lines on all four
    >> sides. The documentation doesn't say the colour will
    >> change.
    >>
    >>> sessionInfo()
    >> R version 3.1.1 (2014-07-10) Platform:
    >> x86_64-unknown-linux-gnu (64-bit)
    >>
    >> --------------------------------------
    >> Dario Strbenac PhD Student University of Sydney
    >> Camperdown NSW 2050 Australia
    >>
    >> ______________________________________________
    >> [hidden email] mailing list
    >> https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do
    >> read the posting guide
    >> http://www.R-project.org/posting-guide.html and provide
    >> commented, minimal, self-contained, reproducible code.

    > ______________________________________________
    > [hidden email] mailing list
    > https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do
    > read the posting guide
    > http://www.R-project.org/posting-guide.html and provide
    > commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: yaxs Causes Boundary Line Colour to Change

Dario Strbenac-2
Thanks for drawing my attention to the zero.line argument. I had only checked the help page for par.

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: yaxs Causes Boundary Line Colour to Change

Patrick Connolly-4
In reply to this post by Sarah Goslee
I can't reproduce it either using x11 or pdf devices.  I'm curious to
know just how you manage to get that result.


On Mon, 25-Aug-2014 at 10:15AM -0400, Sarah Goslee wrote:

|> I can't reproduce this on R 3.1.0 on linux or R 3.1.1 on Mac, using
|> the default graphics device on each.
|>
|> What graphics device are you using?
|>
|> If all else fails, you could use box() to draw over it.
|>
|> Sarah
|>
|> On Mon, Aug 25, 2014 at 8:00 AM, Dario Strbenac
|> <[hidden email]> wrote:
|> > Why is the bottom boundary plotted in a different colour to the other three sides ?
|> >
|> > set.seed(4444)
|> > data <- rpois(10, 2)
|> > plot(density(data), ann = FALSE, yaxs = 'i') # Grey bottom boundary.
|> > plot(density(data), ann = FALSE) # All boundaries are black.
|> >
|> > Ideally, there would be black lines on all four sides. The documentation doesn't say the colour will change.
|> >
|> >> sessionInfo()
|> > R version 3.1.1 (2014-07-10)
|> > Platform: x86_64-unknown-linux-gnu (64-bit)
|> >
|> > --------------------------------------
|> > Dario Strbenac
|> > PhD Student
|> > University of Sydney
|> > Camperdown NSW 2050
|> > Australia
|> >
|> > ______________________________________________
|> > [hidden email] mailing list
|> > https://stat.ethz.ch/mailman/listinfo/r-help
|> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
|> > and provide commented, minimal, self-contained, reproducible code.
|>
|>
|>
|> --
|> Sarah Goslee
|> http://www.functionaldiversity.org
|>
|> ______________________________________________
|> [hidden email] mailing list
|> https://stat.ethz.ch/mailman/listinfo/r-help
|> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
|> and provide commented, minimal, self-contained, reproducible code.

--
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.  
   ___    Patrick Connolly  
 {~._.~}                   Great minds discuss ideas    
 _( Y )_           Average minds discuss events
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)                        ..... Eleanor Roosevelt
         
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.