Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to do:

ListPlot[{{x1, y1}, {x2, y2}, ...}]

each y being not a number but a list of numbers. I tried:

ListPlot[{{x1, {y1}}, {x2, {y2}}, ...}] 

but it does not work.

Does anybody now how to do this?

Thanks a lot!

share|improve this question
    
Could you show a small, concrete example ? –  b.gatessucks Mar 28 '13 at 9:43
    
Yes, here the example: –  Mencia Mar 28 '13 at 9:47
    
ListPlot[{{5, {1., 2., 3.}}, {6.5, {7., 14., 21.}}, {10, {50., 100., 150.`}}}] –  Mencia Mar 28 '13 at 9:47
    
Could you mean something like this? listA={{5,1},{6.5,7},{10,50}}; listB={{5,2},{6.5,14},{10,100}}; listC={{5,3},{6.5,21},{10,150}}; ListPlot[{listA,listB,listC}] –  Sosi Mar 28 '13 at 9:54
    
That would work, but the thing is that the y lists are huge arrays of values. But I will try figure out how to convert my big y arrays into what you suggested. Thanks! –  Mencia Mar 28 '13 at 10:01

2 Answers 2

I'm going with @Sosi 's interpretation :

data = {{5, {1., 2., 3.}}, {6.5, {7., 14., 21.}}, {10, {50., 100., 150.`}}};
ListLogPlot[Transpose[Thread[#]  & /@ data], 
  PlotRange -> {All, Automatic}, AxesOrigin -> {0, 0}]
share|improve this answer
    
Infinite thanks! @b.gatessucks's solution works perfect for me(with out the Log). –  Mencia Mar 28 '13 at 10:14
{y1, y2, y3} = Table[i x, {i, 3}, {x, 0, 10}];
yourList = {{1, y1}, {2, y2}, {3, y3}};

toPlot = yourList /. {x_, l_List} :> ({x, #} & /@ l);
ListPlot[Transpose@toPlot, Joined -> True, Mesh -> All]

Mathematica graphics

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.