I want to show the origin of the plot at (1,1) but can't do it with the following R code. I would add some line segments later to the plot.
xMax <- 600
yMax <- 150
plot(0, type = "n",
xlab = "XVal",
ylab = "YVal",
xlim = c(1, xMax),
ylim = c(1, yMax),
xaxs="i",
yaxs="i"
)
CodePudding user response:
Simply add it using axis
:
xMax <- 600
yMax <- 150
plot(0, type = "n",
xlab = "XVal",
ylab = "YVal",
xlim = c(1, xMax),
ylim = c(1, yMax),
xaxs="i",
yaxs="i"
)
axis(1, at = 1) ## add this
axis(2, at = 1) ## add this