Message Boards Message Boards


How do you plot a list of lists, such that all entries of list[i] have x=i?

Posted 10 years ago
1 Reply
2 Total Likes

as in despcription:
I have a List of Lists { {List1}, {List2}, ... } each list, has the form {y1,y2,...}. I want to create a plot such that, all the points in list1 have the x-coordinate 1, all points in list2 have the x-coordinate 2 and so on.
Could you please tell me how to do this?

Thank you very much emoticon
POSTED BY: Max Mustermann
lst = Table[RandomReal[1, {10}], {3}];
p = MapThread[Function[{i, lst}, List[i, #] & /@ lst], {Range[Length@lst], lst}];
Grid[{ListPlot[#] & /@ p}, Frame -> All]

All in one
Show[ListPlot[#] & /@ p, PlotRange -> All]

POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract