I have two datasets (`df1` and `df2`) that are plotted.

```
df1 = data.frame(x=c(1:10), y=c(1:10))
df2 = data.frame(x=c(0:13), y=c(0:13)^1.2)

# plot
plot(df1)
# add lines of another dataset
lines(df2)

```

Some values of `df2` are out of the plot-range and thus not visible. (In this example I could just plot `df2` first). I usually try to find out the ranges of my data, as shown below.

```
# manual solution
minX = min(df1$x, df2$x)
minY = min(df1$y, df2$y)
maxX = max(df1$x, df2$x)
maxY = max(df1$y, df2$y)

plot (df1, xlim=c(minX, maxX), ylim=c(minY, maxY))
lines(df2)

```

When having many datasets, this becomes annoying. I was wondering, if there is an easier way of adjusting the ranges of the axis.
In the first step R finds axis ranges itself. Is there also a way that R adjusts the axis-ranges, when new datasets are added?