[R] rotate bar labels in barplot()
Peter Alspach
PAlspach at hortresearch.co.nz
Thu Apr 3 03:27:05 CEST 2008
Ricardo
I suggest you modify the mar argument of par. For example,
barplot(1:10, names=rep(paste(letters[1:26], collapse=' '), 10), las=2)
the labels won't fit with the default settings, so try:
par(mar=c(20,4,4,2))
barplot(1:10, names=rep(paste(letters[1:26], collapse=' '), 10), las=2)
There's a lot in ?par - it is worth studying closely ....
Peter Alspach
> -----Original Message-----
> From: [Ricardo Rodriguez] Your XEN ICT Team
> [mailto:webmaster at xen.net]
> Sent: Thursday, 3 April 2008 2:08 p.m.
> To: Peter Alspach; r-help at r-project.org
> Subject: Re: [R] rotate bar labels in barplot()
>
> Thanks Peter,
>
> Peter Alspach wrote:
> > Ricardo
> >
> > The las argument will allow rotation of 90 degrees:
> >
> > par(mfrow=c(2,2))
> > barplot(1:10, names=letters[1:10], las=0) barplot(1:10,
> > names=letters[1:10], las=1) barplot(1:10,
> names=letters[1:10], las=2)
> > barplot(1:10, names=letters[1:10], las=3)
> >
> > If you want to do other rotation angles then it will be
> more complicated (but not much).
> >
>
> 90ª will be OK. But I am afraid I will have to move to axis() anyway.
> Look at this...
>
> http://mire.environmentalchange.net/~webmaster/images/BarPlotLabel.png
>
> It seems there is not enough room for labels. Even those that
> are short enough aren't always displayed. If I use letters,
> they do just fine.
> Could I control this space? I am afraid that I don't
> understand this ...
> at the bottom of the arguments list in ?barplot or any other
> R function :-(
>
> Thank you so much for your help,
>
> Ricardo
>
> --
> Ricardo Rodríguez
> Your XEN ICT Team
>
>
The contents of this e-mail are privileged and/or confidential to the named
recipient and are not to be used by any other person and/or organisation.
If you have received this e-mail in error, please notify the sender and delete
all material pertaining to this e-mail.
More information about the R-help
mailing list