Thanks a lot, Henrique and Christos! It works fine....
Quoting Christos Hatzis <[EMAIL PROTECTED]>: > Udo, > > You can try inserting a newline where you need the break in your labels: > > > dd.names <- c('Conduct Disorders','Attention Deficit', 'Eating Disorders', > 'Substance Abuse','Developmental Disorders') > > dd.names.2 <- sapply(dd.names, function(x) gsub("\\s", "\\\n", x)) > > barplot(dd, names.arg=dd.names.2) > > -Christos > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Udo > > Sent: Wednesday, October 29, 2008 2:43 PM > > To: r-help@r-project.org > > Subject: [R] Barplot: Vertical bars with long labels > > > > Dear List, > > I need a barplot with vertical bars. Each bar should have a label. > > The problem is, that the labels are too long, so they > > overlap, or only every seccond label is displayed in the output. > > > > Here is a little syntax: > > > > dd <- c(100,110,90,105,95) > > barplot(dd,names.arg=c('Conduct Disorders','Attention Deficit', > > 'Eating Disorders', > > 'Substance Abuse','Developmental Disorders')) > > > > My question is, if there is a chance to force a line break in > > each label. > > > > The result shoud look like this: > > > > Bar1 Bar2 Bar3 Bar4 Bar5 > > Conduct Attention Eating Substance Developmental > > Disorders Disorders Disorders Abuse Disorders > > > > > > > > The result could also look like this: > > > > Bar1 Bar2 Bar3 Bar4 Bar5 > > | | | | | > > Conduct Disorders | Eating Disordes | > > Developmental Disordes > > | | > > Attention deficit Substance Abuse > > > > > > > > > > Many thanks in advance > > Udo > > > > > > > > -------------------------------------------- > > Udo K N G > > Ö I > > > > Clinic for Child an Adolescent Psychiatry Philipps University > > of Marburg / Germany > > > > ______________________________________________ > > R-help@r-project.org 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. > > > > > > > -------------------------------------------- Udo K N G Ö I Clinic for Child an Adolescent Psychiatry Philipps University of Marburg / Germany ______________________________________________ R-help@r-project.org 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.