R: fixed x axis scaling and converting plot() xy arguments to points() <p>I have a data.frame <code>xy</code> which I am plotting like in the code below. </p> <p>Is there a way how I could convert my <code>xx</code> and <code>yy</code> in the xy plot() to a <code>points()</code> command so that I could set <code>type='n'</code> and add <code>points()</code> after the segments commands in order to control it better?</p> <pre><code>xy &lt;- data.frame(NAME=c("NAME1","NAME1","NAME1","NAME2","NAME2","NAME2"),ID=c(87,87,87,199,199,199), X_START_YEAR=c(1984,1986,1984,1899,1909,1924),Y_START_VALUE=c(75,25,-90,-8,-55,-10),X_END_YEAR=c(1986,1994,1999,1909,1924,1927), Y_END_VALUE=c(20,50,-15,-70,-80,-100)) xy NAME ID X_START_YEAR Y_START_VALUE X_END_YEAR Y_END_VALUE 1 NAME1 87 1984 75 1986 20 2 NAME1 87 1986 25 1994 50 3 NAME1 87 1984 -90 1999 -15 4 NAME2 199 1899 -8 1909 -70 5 NAME2 199 1909 -55 1924 -80 6 NAME2 199 1924 -10 1927 -100 ind &lt;- split(xy,xy$ID) for (x in ind){ xx = unlist(x[,grep('X_',colnames(x))]) yy = unlist(x[,grep('Y_',colnames(x))]) fname &lt;- paste0(x[1, 'ID'], '.png') png(fname, width=1679, height=1165, res=150) par(mar=c(6,8,6,5)) plot(xx, yy, main=unique(x[,1]), xlab="Time [Years]", ylab="Value [m]") axis(1, at = seq(1000, 2050, 5), cex.axis=1, labels=FALSE, tcl=-0.3) axis(2, at = seq(-100000, 100000, 500), cex.axis=1, labels=FALSE, tcl=-0.3) x &lt;- x[,-1] segments(x[,2],x[,3],x[,4],x[,5],lwd=2) dev.off() } </code></pre> <p>If it is possible it would be great if the x axis could be at a fixed range (e.g. from 1940 to 2014) and if values before 1940 are present the x axis should be automatic. The range of the y-axis always differs. How could I incorporate that in my code?</p>