[R] plot: many bars with wide bars

Jim Lemon jim at bitwrit.com.au
Fri May 11 15:10:27 CEST 2012


On 05/11/2012 09:33 PM, Marion Wenty wrote:
> Hello,
>
> I have got another problem.
>
> I wrote a function which is able to create plots with different numbers of
> bars.
>
> In order to give them a similar look I determined the width of the bars
> using the parameters
>
> width=0.59
>
> AND
>
> ylim=c(0,10))
>
> (see function below)
>
> Now, this only works if I have just got up to 6 double bars. In the
> following example it doesn't work because the bars for the line "Tab der
> offe;9;11" are missing.
>
> I would like to be able to create the plots up to more double bars (maybe 9
> or so).
>
> Does anyone know the ansers to this problem?
> Thanks a lot in advance!!
>
> Marion
>
> function:
>
> My .csv file " abb7ctreff " looks like this:
>
> ;bisher;in Zukunft
> persönl Ges;55;24
> andere Vera;45;23
> Elternabende;39;26
> Gespräche;18;11
> persönl ;16;4
> Schulunterr;14;9
> Tag der offe;9;11
>
Hi Marion,
Try this:

library(plotrix)
barp(t(abb7dtreff[,2:3]),names.arg=abb7dtreff[,1],staxx=TRUE)

and if that does what you want, look at the code in the barp function, I 
think you are trying to do the same thing.

Jim



More information about the R-help mailing list