Re: [R] Force labelling of x-axis

From: Renaud Lancelot <renaud.lancelot_at_cirad.fr>
Date: Mon 21 Mar 2005 - 16:34:07 EST

Bill Kranec a écrit :

> Hi,
>
> I'm trying to do a box-whisker plot of two columns of a data frame, a
> list of category names in one column vs. some numerical values in the
> other. The plot itself works fine, but only a few points of the x-axis
> ( the category names ) are labelled. I think that this is because the
> category names are too long.
>
> Is there any way to force R to label each x-axis value, preferably at a
> 45-degree slant so that each one can be seen? I feel like this should be
> pretty easy to do, but I can't find anything obvious from the R-manual.
>
> Thanks for any help,
>
> Bill
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

For example:

test <- data.frame(

           y = rnorm(120),
           x = rep(month.name, each = 100))
library(lattice)
bwplot(y ~ x, data = test, scales = list(x = list(rot = 45)))

Best,

Renaud

-- 
Dr Renaud Lancelot, vétérinaire
C/0 Ambassade de France - SCAC
BP 834 Antananarivo 101 - Madagascar

e-mail: renaud.lancelot@cirad.fr
tel.:   +261 32 40 165 53 (cell)
         +261 20 22 665 36 ext. 225 (work)
         +261 20 22 494 37 (home)

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon Mar 21 16:39:22 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:51 EST