ListPlot multiple datasets over same x-values

Is there a better way to enter my data into a list plot?

ListPLot[{{{1.1, 2.2}, {2.3, 4.3}, {2.9, 5.5}},
{{1.1, 2.1}, {2.3, 4.6}, {2.9, 5.9}},
{{1.1, 2}, {2.3, 4.8}, {2.9, 6.2}}}]


I think there should be a more efficient way, but cannot find it. I've read the documentation on ListPlot and DataRange.

-
By more efficient, I mean without typing the values of the independent variables more than once. For large data sets, this would be a waste of time. – Joe Nov 16 '13 at 2:50
Please clarify what you mean by "independent" variable. What does you original data look like? – Yves Klett Nov 16 '13 at 7:16

times = {1.1, 2.3, 2.9}; (* list of x values *)
states = {{2.2, 4.3, 5.5}, {2.1, 4.6, 5.9}, {2, 4.8, 6.2}}; (* lists of y values *)

td = TemporalData[states, {times}];
ListPlot[td, BaseStyle -> PointSize[.02], PlotRange -> {0, 7}]


-
That's terrific! Thank you for introducing me to TemporalData. That's exactly the type of functionality that I was hoping existed in Mathematica. – Joe Nov 10 '14 at 1:15
Joe, my pleasure. Thank you for the Accept. – kglr Nov 12 '14 at 1:14
Joe, please read the FAQs. Also when you see good questions and answers you can vote them up by clicking the gray triangles. Btw, it is expected that you would upvote an answer that you find worthy of Accept ;) – kglr Nov 12 '14 at 1:19
Thank you for letting me know what those triangle did. I had no idea. – Joe Nov 13 '14 at 12:42

A different approach, following J.W. Perry's structure,

ivar = {1.1, 2.3, 2.9};
dvars = {{2.2, 4.3, 5.5}, {2.1, 4.6, 5.9}, {2, 4.8, 6.2}}

data = Inner[List, ivar, #, List] & /@ dvars


Or, generalized (any number of dimensions),

data = MapThread[Flatten @* List, {ivar, #}] & /@ dvars


It might seem convoluted at first, but once you get acquainted with high level operators (Inner, Outer, MapThread...), "For" loops will look too verbose.

-

If all what you want is to plot the data, then simply leave it as is, and use Show to combine the plots.

ivar = {1.1, 2.3, 2.9};
dvars = {{2.2, 4.3, 5.5}, {2.1, 4.6, 5.9}, {2, 4.8, 6.2}};
Show[ ListPlot[{ivar, #}] & /@ dvars ]


or to get more control of final layout, add more options to Show

Show[ListPlot[{ivar, #}] & /@ dvars, PlotRange -> All, AxesOrigin -> {0, 0}]


-

Here I have assigned ivar to be your independent variables. You can add as many triplets as you want to dvars in this code and build the set data:

ivar = {1.1, 2.3, 2.9}; (*your independent variable values*)
dvars = {{2.2, 4.3, 5.5}, {2.1, 4.6, 5.9}, {2, 4.8, 6.2}}; (*dependent variables*)
data = {}; (*your data set*)
For[i = 1, i <= Length[dvars], i++,
AppendTo[data,
Table[{ivar[[j]], dvars[[i]][[j]]}, {j, 1, Length[ivar]}]
]
]


You can view data of course, and you can produce your output with

ListPlot[data]


This will alleviate the repeated typing of ivars for your larger data set. Judicious modification of the Length[ ] function should make this code scalable for different tuple sets.

-
Thank you! Your programming skills far exceed mine. I was hoping mathematica had a built-in easy way to do it. – Joe Nov 16 '13 at 17:47