Re: [R] Misunderstanding with lines (or elsewhere)

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue 11 Jul 2006 - 22:25:11 EST

Think about the coordinate system you are using: if you don't set the margins to zero you will see what it is.

I suggest you supply x and y to image() to set the coordinate system to what you want it to be.

On Tue, 11 Jul 2006, vincent@7d4.com wrote:

> Misunderstanding with lines(...) :
> http://7d4.com/r/
>
> I would like the y coordinate of the horizontal line to be 1/4,
> and also the line to begin at x=0 and end at y=1.

And that is what you get.

> I'm obviously missing something
> ... so if anybody could help.
>
> Many thanks.
>
>
> test = function()
> {
> bmp('test.bmp', width=100, height=100)
> m = matrix(0, 2, 2)
> par(new=T, fig = c(0,1,0,1), mai=c(0,0,0,0), mar=c(0,0,0,0), bty='n')
> image(m)
> lines(c(0,1), c(1/4,1/4)) # horizontal line
> a = dev.off()
> }
>
>
> The result :
> http://7d4.com/r/
>
> ______________________________________________
> R-help@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
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@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
Received on Tue Jul 11 22:28:22 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 12 Jul 2006 - 00:20:39 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.