[R] axis: forcing last label to print

Shawn Polson polson at dbi.udel.edu
Sun Sep 20 06:12:40 CEST 2009


Hello,

I often use the axis command to add labels to axes with large numbers of
consecutively numbered names:

y<- barplot (x, log="x")
axis(1, at = y, labels = c(1:12345))

Since there are more labels than will fit in the space, the command only
prints selected labels.  This is what I want, except that it never actually
prints a label for the final item.  Thus I end up with labels something like
this:

1  16  123  1432  2134  3235  6578  11385

when I really want the last label displayed to be the final category number
(12345):

1  16  123  1432  2134  3235  6578   12345

Short of manually choosing the labels, does anyone know a way to force the
last category to be among those printed when axis selects labels?

Thanks,
Shawn Polson

Delaware Biotechnology Institute
University of Delaware
-- 
View this message in context: http://www.nabble.com/axis%3A-forcing-last-label-to-print-tp25527633p25527633.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list