Re: [R] line break in pie chart labels

From: Peter Dalgaard <>
Date: Thu 28 Sep 2006 - 08:02:41 GMT

Jim Lemon <> writes:

> > Given a pie chart with some really long labels can R insert line breaks
> > here? Why I imagine is getting a label displayed as

> pie(1:4,labels=c("The first\nlong label",
> "The second, even\nlonger label",
> "The third, quite\nboring and\nstill longer\nlabel",
> "The fourth, final\nflagrantly\nverbose and\nlongest label\nof the lot"))

In 2.4.0-to-be pie() is happier with plotmath labels, so atop() could have be another solution. In 2.3.1

> pie(c(2,3),labels=expression(pi_1,pi_2))
Error in lab != "" : comparison is not allowed for expressions In addition: Warning message: applied to non-(list or vector) in: <- labels[i])

but in the prerelease versions, you get to eat you pie() and have your pi's too.

   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (                  FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu Sep 28 18:05:48 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 Thu 28 Sep 2006 - 08:30:07 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.