Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4089 > unrolled thread

Re: Pie Chart - Labeled Input

Started byHeike Gramberg <heike.gramberg@gmail.com>
First post2011-07-30 11:21 +0000
Last post2011-07-30 11:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Pie Chart - Labeled Input Heike Gramberg <heike.gramberg@gmail.com> - 2011-07-30 11:21 +0000

#4089 — Re: Pie Chart - Labeled Input

FromHeike Gramberg <heike.gramberg@gmail.com>
Date2011-07-30 11:21 +0000
SubjectRe: Pie Chart - Labeled Input
Message-ID<j10pfs$prh$1@smc.vnet.net>
You could use Apply instead of Map, i.e.

PieChart[Labeled[##] & @@@ Transpose[{lst1, lst2, lst3}]]

or alternatively using MapThread:

PieChart[MapThread[Labeled[##] &, {lst1, lst2, lst3}]]

Heike

On 30 Jul 2011, at 11:02, Don wrote:

> I am trying to generalize the following
> PieChart function where I can programmatically
> change the number of labeled pieces in the pie.
> 
> PieChart[{Labeled[1,"label 1","VerticalCallout"],Labeled[2,"label
> 2","VerticalCallout"],Labeled[3,"label
> 3","VerticalCallout"]},PlotRange->1.5]
> 
> For e.g. given the following three lists, how can one form the input
> that the Pie Chart function above expects?
> 
> lst1 = {1,2,3}
> lst2 =  {"label 1", "label 2", "label 3"}
> lst3 = Table["VerticalCallout", {Length[lst1]}]
> 
> For e.g. if one makes a single list of the three lists above
> and then tries to map the Labeled function over each
> element of this single list,  a syntax error is generated:
> 
> (1) singleList =  Flatten[#]& /@ Transpose[{lst1,
> Transpose[{lst2,lst3}]}]
> 
> (2) Labeled[#]& /@ singleList
> 
> Mathematica does not like statement 2 because Labeled is expecting
> more than one input.  The obvious direct "solution" above is a
> loser.
> 
> Don
> 

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web