[R] barplot question

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Oct 18 00:04:36 CEST 2006


On 10/17/06, Leeds, Mark (IED) <Mark.Leeds at 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



More information about the R-help mailing list