MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: List question

  • To: mathgroup at
  • Subject: [mg21012] Re: [mg20972] List question
  • From: "Tomas Garza" <tgarza at>
  • Date: Thu, 2 Dec 1999 21:41:24 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Bill [bcash at] wrote:

> I am making a list of lists to be used by MultipleListPlot.  How do I
> remove the outer brackets when I give it to the function?

Perhaps you could be more specific. If you look at the example given in the
Help Browser in Add-Ons Graphics`MultipleListPlot` it seems unnecesary to
remove the outer brackets:

<< Graphics`MultipleListPlot`

(list1 = Table[{x, Sin[2 Pi x]}, {x, 0, 1, 0.2}];
    list2 = Table[{x, Cos[2 Pi x]}, {x, 0, 1, 0.1}]);

(I deliberately modified the iterator in the first list so as to make them
of different lengths,  just to be a little more general)

listOfLists = {list1, list2};


The output is omitted here, but it was OK. In any case, if you really want
to get rid of the outer brackets, you might use a combination of Flatten and
Partition. Thus, for example,

list1A = Partition[Flatten[Take[listOfLists, 1]], 2];
list2B = Partition[Flatten[Rest[listOfLists]], 2];

MultipleListPlot[list1A, list2B]

will give the same result as above.

Tomas Garza
Mexico City

  • Prev by Date: Re: A question of simplification
  • Next by Date: A list of Mathematica characters
  • Previous by thread: Re: List question
  • Next by thread: Re: List question