Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to query axis limits in R?

Tags:

Is it possible to get the axis limits for the current plot in R? How?

Preferably in the standard base library (I don't like to use ggplot etc., but these solutions are also welcome).

like image 206
Tomas Avatar asked Sep 15 '11 09:09

Tomas


People also ask

How do I change axis limits in R?

To change the axis scales on a plot in base R Language, we can use the xlim() and ylim() functions. The xlim() and ylim() functions are convenience functions that set the limit of the x-axis and y-axis respectively.

What are axis limits?

axis( limits ) specifies the limits for the current axes. Specify the limits as vector of four, six, or eight elements. example. axis style uses a predefined style to set the limits and scaling.

What does XLIM do in R?

The xlim() function with the provided parameters as the range of the x-axis in vectors is used to set the x-axis without dropping any data of the given plot or an object accordingly. Parameters: …: if numeric, will create a continuous scale, if factor or character, will create a discrete scale.

What does YLIM mean in R?

ylim( limits ) sets the y-axis limits for the current axes or chart.


1 Answers

par("usr") 

That ought to do it; see ?par.

like image 197
mdsumner Avatar answered Oct 09 '22 06:10

mdsumner