Hi everyone. I would like to modify the axis on my plot. First, I would like to make a plot without the box. so I use : plot(x,y, axes = FALSE, type = 'l') Then, I call : axis(1, tck = -0.02) axis(2, tck = -0.02) to have X and Y axis appear. However, I would like them to join at the origin instead of having a space between the 2 axis. I can't find the parameter to modify to get this result. Secondly, is it possible to center X and Y axis so the origin is right in the center of the graph. With regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Axis-positions-tp3308473p3308473.html Sent from the R help mailing list archive at Nabble.com.
try using box(), e.g., plot(x, y, axes = FALSE, type = 'l') axis(1, tck = -0.02) axis(2, tck = -0.02) box(bty = "l") I hope it helps. Best, Dimitris On 2/16/2011 10:45 AM, Filoche wrote:> > Hi everyone. > > I would like to modify the axis on my plot. > > First, I would like to make a plot without the box. so I use : > > plot(x,y, axes = FALSE, type = 'l') > > Then, I call : > > axis(1, tck = -0.02) > axis(2, tck = -0.02) > > to have X and Y axis appear. However, I would like them to join at the > origin instead of having a space between the 2 axis. I can't find the > parameter to modify to get this result. > > Secondly, is it possible to center X and Y axis so the origin is right in > the center of the graph. > > With regards, > Phil-- Dimitris Rizopoulos Assistant Professor Department of Biostatistics Erasmus University Medical Center Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands Tel: +31/(0)10/7043478 Fax: +31/(0)10/7043014 Web: http://www.erasmusmc.nl/biostatistiek/
On 02/16/2011 08:45 PM, Filoche wrote:> > Hi everyone. > > I would like to modify the axis on my plot. > > First, I would like to make a plot without the box. so I use : > > plot(x,y, axes = FALSE, type = 'l') > > Then, I call : > > axis(1, tck = -0.02) > axis(2, tck = -0.02) > > to have X and Y axis appear. However, I would like them to join at the > origin instead of having a space between the 2 axis. I can't find the > parameter to modify to get this result. > > Secondly, is it possible to center X and Y axis so the origin is right in > the center of the graph. >Hi Phil, For number 1, look at fullaxis (plotrix). For number 2, use something like: plot(...,xlim=c(-1,1),ylim=c(-1,1),...) in other words, use plot limits with zero in the middle. Jim
Apparently Analagous Threads
- Hist and extra space
- lattice: axis ticks, axis alignment and remove axis from plot
- axis() produces junk on DEC alpha (PR#274)
- bwplot [lattice]: how to get different y-axis scales for each row?
- FW: RES: bug in axis.Date? was (Re: newbie needs help plottingtimeseries)