Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, the plot function in R allows manual specification of a single limit through the "xlim" and "ylim" arguments.

For example, to manually set the x-axis limit from 0 to 10 and leave the y-axis limit to be automatically adjusted by R, you can use the following code:

plot(x, y, xlim = c(0, 10))

Similarly, to manually set the y-axis limit from -5 to 5 and leave the x-axis limit to be automatically adjusted by R, you can use:

plot(x, y, ylim = c(-5, 5))

If you want to manually set both x and y limits, you can use both arguments:

plot(x, y, xlim = c(0, 10), ylim = c(-5, 5))