Ask Your Question
2

Does the plot function in R have a provision to manually specify a single limit?

asked 2022-02-13 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-19 03:00:00 +0000

qstack gravatar image

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))
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-02-13 11:00:00 +0000

Seen: 13 times

Last updated: Jun 19 '21