Skip to content
Prev 205941 / 398502 Next

How to control number of significant digits (figures) in y-axis?

Use the 'scales=' argument together with formatC:

x <- 1:10
y <- sample(10)
xyplot(y ~ x,
   scales = list(
              y = list(
                at = 1:10,
                lab = formatC(1:10,
                  format = "f", digits = 1))))

?formatC
?xyplot

  -Peter Ehlers
willow1980 wrote: