[R] graphics question: tilted axis labels?

Charilaos Skiadas skiadas at hanover.edu
Fri Apr 13 15:27:05 CEST 2007


Your problem is different I think, it's the fact that LA$countries is  
a factor, and hence you see the factor levels instead of their  
labels. Try:

# create data frame
   LA <- data.frame(countries=c("Chile", "Peru", "Bolivia"), values=c
(10, 12, 13), stringsAsFactors = FALSE)
# call barplot
barplot(LA$values, names.arg=LA$countries)

On Apr 13, 2007, at 9:02 AM, Christoph Heibl wrote:

> I´m sorry, I did not provide any code.
>
> Here is now a small example:
>
> # create data frame
>   LA <- data.frame(countries=c("Chile", "Peru", "Bolivia"), values=c
> (10, 12, 13))
> # call barplot
>   barplot(LA$values, names.arg=LA$countries)
> # Countries names are not plotted, but their index numbers instead.
> # So again the question:
> # How can I tilt the angles in order to make whole names fit?
>
> Thanks
> Christoph

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College



More information about the R-help mailing list