On Jun 12, 2009, at 7:18 AM, Paul Chatfield wrote:


I'm trying to plot a graph where the axes go through 0,0, rather than around
it combined with a box round the graph, so

x<-0:10;y<-0:10
plot(x,y)

gives me a box but doesn't go through the point 0,0, but stays at a
distance.

In trying to circumvent this problem, I wrote

plot(x,y)
axis(1, pos=c(0,0));axis(2,pos=c(0,0))

which gives me axes that go through the origin, but then I can't make a box round a plot (box() goes again at this fixed distance from the origin rather
than through it)

Any thoughts, ideas gratefully accepted. Perhaps I've been looking at it so
long I'm now missing the obvious! :)

Paul

Any ideas?


See ?par and take note of 'xaxs' and 'yaxs':

  x <- 0:10
  y <- 0:10
  plot(x, y, xaxs = "i", yaxs = "i")

HTH,

Marc Schwartz

______________________________________________
R-help@r-project.org 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 via email to