To change the limits for the axes in ggplot2 graphs, you can add the following functions to your graphs:

To change limits for the x-axis

xlim(-5000, 5000)

To change the limits for the y-axis

ylim(-5000,5000)

You can also use the **scale_x_continuous ()** and **scale_y_continuous()** as follows:

scale_x_continuous(limits =c(-5000,5000))

scale_y_continuous(limits = c(-5000,5000))

Both of these methods will remove all the data points outside the given range of limits.

To adjust the visible area without removing the points, use the following function:

coord_cartesian(xlim = c(-5000, 5000))

If you want to learn more about R programming watch this tutorial on Introduction to Data Science with R