Axis scale in R software : minimum, maximum and log scale

The goal of this article is to show you how to set x and y axis limites by specifying the minimum and the maximum values of each axis. We’ll also see in this this tutorial how to set the log scale.


The following plot parameters can be used :

  • xlim: the limit of x axis; format : xlim = c(min, max)
  • ylim: the limit of y axis; format: ylim = c(min, max)

Transformation to log scale:

  • log = “x”
  • log = “y”
  • log = “xy”*

log : character indicating if x or y or both coordinates should be plotted in log scale.


x<-1:10; y=x*x
# Simple graph
plot(x, y)
# Enlarge the scale
plot(x, y, xlim=c(1,15), ylim=c(1,150))
# Log scale
plot(x, y, log="y")

Logiciel R : Echelle des axesLogiciel R : Echelle des axesLogiciel R : Echelle des axes


This analysis has been performed using R statistical software (ver. 3.1.0).

Enjoyed this article? I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter, Facebook or Linked In.

Show me some love with the like buttons below... Thank you and please don't forget to share and comment below!!
Avez vous aimé cet article? Je vous serais très reconnaissant si vous aidiez à sa diffusion en l'envoyant par courriel à un ami ou en le partageant sur Twitter, Facebook ou Linked In.

Montrez-moi un peu d'amour avec les like ci-dessous ... Merci et n'oubliez pas, s'il vous plaît, de partager et de commenter ci-dessous!

This page has been seen 300675 times