Re: [R] barplot question

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Tue 17 Oct 2006 - 22:04:36 GMT

On 10/17/06, Leeds, Mark (IED) <Mark.Leeds@morganstanley.com> wrote:
> i'm doing a bar plot and there are 16 column variables. is there a way
> to make the variable names go down instead of across when you do the
> barplot ?
> because the names are so long, the barplot just shows 3 names and leaves
> the rest out. if i could rotate the names 90 degrees, it would probably
> fit a lot more.
> or maybe i can use space to make the horizontal width longer ? I looed
> up ?barlot but i'm not sure. when 1st and 2nd are on the bottom,
> things look fine but i'm not as interesed in those 2 barplots.
>
> i didn't use any special options. i just did
>
> barplot(probsignmatrix)
> barplot(t(probsignmatrix))
>
> barplot(probsignmatrix,beside=T)
> barplot(t(probsignmatrix),beside=T)
>
>
>
> i put probsignmatrix below in case someone wants to see what i mean
> because it may not be clear. i don't expect anyone to type it in but
> rounding would still show what i mean.
> thanks a lot.
>
>
> pppppcount pmpppcount pmmppcount pmmmpcount pmmmmcount ppppmcount
> pppmmcount ppmmmcount ppmppcount ppmmpcount pppmpcount ppmpmcount
> pmpmpcount pmpmmcount pmmpmcount pmppmcount
> 1st 0.03477157 0.02842640 0.03157360 0.03365482 0.04010152 0.03553299
> 0.03989848 0.04182741 0.02817259 0.03203046 0.02781726 0.02218274
> 0.01771574 0.02289340 0.02583756 0.02390863
> 2nd 0.04648895 0.02901495 0.03092490 0.03064044 0.04108420 0.03998700
> 0.03958062 0.04059655 0.03039662 0.03027471 0.02901495 0.02170026
> 0.01601105 0.02287874 0.02165962 0.02267555
> --------------------------------------------------------

Don't know if you want to go this way, but try

library(lattice)
barchart(t(probsignmatrix))

-Deepayan



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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Oct 18 08:12:50 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 17 Oct 2006 - 22:30:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.