[R] graphics question: tilted axis labels?
Charilaos Skiadas
skiadas at hanover.edu
Fri Apr 13 16:39:40 CEST 2007
On Apr 13, 2007, at 9:52 AM, Christoph Heibl wrote:
> Dear Charilaos,
>
> Thanks ... your were right. I now get the names. But the problems
> remains that the space (30 items) is insufficient to bear all the
> names and I am still looking for a way to accommodate them. Do you
> know of any solution?
>
Frankly, if you have a barplot with 30 items, I would rethink the
situation if I were you. As an audience, I would find it hard to
process such a graph. Put it might just be me.
I personally think that tilting them 45, or even 90 degrees is not a
very good idea presentation-wise, and opt instead to have the
barplots be horizontal when something like this happens (barplot
(...,horiz=TRUE) ).
If you look at ?par, you'll find the options "crt" and "srt", which
don't seem to work on the axes, and also have a big warning about not
expecting a 45 degree tilt to always work. You can use "las" to turn
it 90 degrees if you really want that.
I think lattice and grid would allow you perhaps to do exactly what
you want, though it might be somewhat more work.
Sorry, perhaps I was more critical than helpful. Best of luck with it.
PS: Why do drawing commands have different names for the "horizontal"
attribute?
boxplot -> horizontal
barplot -> horiz
> Cheers,
> Christoph
>
>
> On 13.04.2007, at 15:27, Charilaos Skiadas wrote:
>
>> # 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)
>
Haris Skiadas
Department of Mathematics and Computer Science
Hanover College
More information about the R-help
mailing list