0

I want to be able to create multiple piecharts in a list. Each pie chart is an representation of the sequence of each argument.

Example: arguments -> 10, 20

arguments gets compiled into a sequence of numbers:

10 -> {1,2,3,4,5,6,7,8,9,10} and 20 -> {1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20}

Now i need to create a list of piecharts that was formulated by those sequences.

i tried something and it worked but what if there were to be more arguments. How long would my solving code have to be to solve it:

List[PieChart[Range[10]], PieChart[Range[20]]]

enter image description here

Please help me or give me references on how to do this in a smarted way preparing for more arguments.

  • @Phillip Jacobs ... Please help – Shasha Haven Jun 20 '19 at 15:58
  • @DavidBullock ... Please help – Shasha Haven Jun 20 '19 at 15:58
  • 1
    If you study *An Elementary Introduction to the Wolfram Language* up to part 4 you will learn all you need to answer this questions for yourself. SO generally expects people to have made a serious attempt at answering their own questions, asking a question here should be your last resort. In the absence of any code you wrote this looks as if you expect (or just wish) someone to write code for you. That's not how this site works. – High Performance Mark Jun 20 '19 at 16:03
  • @HighPerformanceMark, Thanks for your comment. I did in fact try out the question and passed but passing is not all i want to do. I want to make sure that i do stuff in the best possible way. But i updated my question so you can see what i've tried. If you have a better way, please let me know – Shasha Haven Jun 21 '19 at 07:36
  • I'll try and keep you posted. Thank you @HighPerformanceMark – Shasha Haven Jun 21 '19 at 07:42
  • @HighPerformanceMark , I didn't fin help looking at Table but thanks anyway. – Shasha Haven Jun 21 '19 at 08:28

1 Answers1

2

You should take a look at Map - Wolfram

So lets imagine you have more arguments: {10,20,48,4.2}

What you want to do is Map each function you want to use, on each one of them.

So the functions you used was List, PieChart & Range


soooo....

Map Range to each argument to turn each of them into a sequence of 1 to 'argument' :

Map[Range, {10,20,48,4.2}]

Then map all those lists created by 'Range' to the function PieChart

Map[PieChart, Map[Range, {10,20,48,4.2}]]
PhillipJacobs
  • 2,337
  • 1
  • 16
  • 32