Johannes Graumann
2004-Aug-26 20:47 UTC
[R] how to make lines() meet axis in autoscaled coordinate system?
Hello, I have an auto-scaled coordinate system and would like to add some clarifying lines to the graph - which ares supposed to meet the axis.>lines(c(0,time1,time1), c(1,1,0),lty=3)does what I want, BUT the second leg does not touch the x-axis since the auto-scaling of the y-axis does not start at'0' but slightly negative. I could now adjust the line length by 'trial and error' to suit my needs, but I'd prefer a generalizable solution like>lines(c(<some_macro_for_y-axis_position>,time1,time1),+ c(1,1,<some_macro_for_x-axis_position>),lty=3) Can somebody help me out with this? Thanks, Joh
Rolf Turner
2004-Aug-26 21:15 UTC
[R] how to make lines() meet axis in autoscaled coordinate system?
Johannes Graumann wrote:> I have an auto-scaled coordinate system and would like to add some > clarifying lines to the graph - which ares supposed to meet the axis. > > >lines(c(0,time1,time1), c(1,1,0),lty=3) > > does what I want, BUT the second leg does not touch the x-axis since the > auto-scaling of the y-axis does not start at'0' but slightly negative. > I could now adjust the line length by 'trial and error' to suit my > needs, but I'd prefer a generalizable solution like > > >lines(c(<some_macro_for_y-axis_position>,time1,time1), > + c(1,1,<some_macro_for_x-axis_position>),lty=3)lines(c(par()$usr[1],time1,time1), c(1,1,par()$usr[3]),lty=3) cheers, Rolf Turner rolf at math.unb.ca