# How to plot a list of lists with ListLinePlot?

(edited, after rasher comment, changing any detail and variable names)

You can plot an evolution with 3 lines (up=maximmun, in the middle=mean, bottom=Minimum)

with this code

historytargetmax = {10, 15, 20, 30, 35}
historytargetmean = {6, 8, 10, 13, 15}
historytargetmin = {6, 3, 5, 7, 8}

ListLinePlot[{historytargetmax, historytargetmean,
historytargetmin}, PlotStyle -> {Thickness[0.008]},
AxesLabel -> {"Generation", "Target"}, LabelStyle -> {24, Bold},
ImageSize -> Large]


My question is How do you do this with multiple (for example 3) series.

For example... in the next lines... each list historytarget___ contains 3 list. Each list represent s the maximun/mean/minimun of target function trought iterations {1,2,3,4,5}

We made 3 simulations and in the first simulation we obtain this evolution os maximun {10, 15, 20, 30, 35} and this evolution of mean {6, 8, 10, 13, 15} and this evolution of min {2, 3, 5, 7, 8}

So we would like to view the maximun line in blue, the min-line evolution en green, and min-lin evo in red.

The same in the other 2 simulations.

So finally we can see 3 lines representing the evo of maximun (BLUE and UP) 3 lines representing the evo of mean (GREEN and middle) and 3 lines representing the evo of min (RED and BOTTOM)

for example with

historytargetmax = {{10, 15, 20, 30, 35}, {12, 14, 17, 27,  31}, {11, 12, 22, 32, 32}}
historytargetmean = {{6, 8, 10, 13, 15}, {8, 9, 11, 12, 13}, {11, 12, 12, 13, 19}}
historytargetmin = {{2, 3, 5, 7, 8}, {2, 4, 5, 7, 8}, {6, 2, 5, 3, 7}}


Last thing.- I think that it would be interesting plotting all the maximun series in BLUE all the mean series in GREEN all the minimum series in RED

how to do this?

• istLinePlot[ Join[historyobjetivomejor, historyobjetivomedia, historyobjetivopeor], PlotStyle -> {Blue, Blue, Blue, Green, Green, Green, Red, Red, Red}]
– ciao
Jun 10, 2014 at 5:50
• @rasher, Thank you. It appears to be the solution, but I need to transpose the data. I´m testing. Jun 10, 2014 at 5:56
• @rasher Is that the style I was searching :-) but... I would like to view in blue all the 3 top lines, and in greens the 3 middles lines, and in red the 3 bottom lines. I was trying using Transpose and similar, but nothing good is reached...... I was viewing that you have edited your anwer... Jun 10, 2014 at 6:06
• @rasher I was trying but I obtain the same colors with PlotStyle -> {Blue, Blue, Blue, Green, Green, Green, Red, Red, Red} than with PlotStyle -> {Blue, Green, Red, Blue, Green, Red, Blue, Green, Red} I can´t believe it !! :-O Jun 10, 2014 at 6:09
• To be honest, I was not sure what you're after, which is why I posted the comment and not an answer, and I'm not going to decode the language of the lists to try and figure it out. Perhaps add an English explanation of what is what and what you're trying to do... "3 top lines...3 bottom lines" means nothing to me. Do you want each of the lists to be a distinct color across all sub-lists, or do you mean the first sub-list of each is to share a distinct color, or do you mean...
– ciao
Jun 10, 2014 at 6:27

I'll go ahead and post this rather than having a comment conversation. (ah, just saw your last comment - I'm guessing you had something set that caused goofy result - but this provides two ways of doing the same thing in any case).

(* from the comments *)
plot1 = ListLinePlot[
Join @@ Transpose[{historytargetmax, historytargetmean, historytargetmin}],
PlotStyle -> {Blue, Green, Red},
ImageSize -> 300, PlotRange -> {{1, 5}, {0, 35}}];

(* generate a separate plot for max, mean, and min with separate colors *)
plot2 = Show[