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

From: <vincent_at_7d4.com>
Date: Tue 11 Jul 2006 - 23:39:58 EST

Prof Brian Ripley a écrit :

> 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.

Thank you for your answer.
If I have well understood, the right way to proceed must be :

test = function()
{
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') x0 = c(0.25 , 0.75)
y0 = x0
image(x=x0, y=y0, z=m)
lines(c(0,1), c(1/4,1/4)) # horizontal line }

which seems indeed to work.
Thanks.



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 23:52:50 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 - 04:17:16 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.