Merging labels on Pie chart

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Merging labels on Pie chart

Melanie Zoelck
Dear R Help Members,

I need to draw a pie chart for someone and there are 3 small slices in it identifying different species, all 0.7%, who’s labels overlap so you cannot read them. Is there a way to have only 1 label the three slices, so as to merge the three labels into one without merging the 3 slices? Alternatively, is there a way to extend the pointing lines, so that they could be different heights so as to avoid the overlap.

Thank you!

Melanie
____________________________________________
Melanie Zölck (Zoelck)
PhD Candidate
Galway-Mayo Institute of Technology
Marine and Freshwater Research Centre
Commercial Fisheries Research Group
Department of Life Science
Dublin Road
Galway
Republic of Ireland
Mobile: +353 (0) 85 7246196
Skype: melaniezoelck
E-mail: [hidden email] or [hidden email]


        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Merging labels on Pie chart

Uwe Ligges-3


On 23.02.2013 17:06, Melanie Zoelck wrote:
> Dear R Help Members,
>
> I need to draw a pie chart for someone and there are 3 small slices in it identifying different species, all 0.7%, who’s labels overlap so you cannot read them. Is there a way to have only 1 label the three slices, so as to merge the three labels into one without merging the 3 slices? Alternatively, is there a way to extend the pointing lines, so that they could be different heights so as to avoid the overlap.

Perhaps, or just place text via the text() function separately,  but
even better just use a barplot.

Uwe Ligges


> Thank you!
>
> Melanie
> ____________________________________________
> Melanie Zölck (Zoelck)
> PhD Candidate
> Galway-Mayo Institute of Technology
> Marine and Freshwater Research Centre
> Commercial Fisheries Research Group
> Department of Life Science
> Dublin Road
> Galway
> Republic of Ireland
> Mobile: +353 (0) 85 7246196
> Skype: melaniezoelck
> E-mail: [hidden email] or [hidden email]
>
>
> [[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Merging labels on Pie chart

Jim Lemon
In reply to this post by Melanie Zoelck
On 02/24/2013 03:06 AM, Melanie Zoelck wrote:
> Dear R Help Members,
>
> I need to draw a pie chart for someone and there are 3 small slices in it identifying different species, all 0.7%, who’s labels overlap so you cannot read them. Is there a way to have only 1 label the three slices, so as to merge the three labels into one without merging the 3 slices? Alternatively, is there a way to extend the pointing lines, so that they could be different heights so as to avoid the overlap.
>
Hi Melanie,
Depending upon how much overlap there is, you might be able to use the
floating.pie (plotrix) function:

species.pct<-c(50,30,14,3,2,1)
species.names<-c("Homo sapiens","Pan troglodytes",
  "Gorilla gorilla","Yeti\nasiaticus","Megapodus\nsasquatch",
  "Gargantua\neuropaceae")
library(plotrix)
par(mar=c(5,2,4,3))
plot(0,xlim=c(-1,1),ylim=c(-1,1),axes=FALSE,type="n",xlab="",ylab="")
radpos<-floating.pie(0,0,species.pct,radius=0.8)
radpos[4:6]<-c(5.95,6.1,6.25)
pie.labels(0,0,radpos,species.names,radius=1)

If this is not enough, I think Uwe's suggestion would work.

Jim

______________________________________________
[hidden email] 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.