# How to plot multiple functions in a graph with different colors?

I have a general {i,x,y} dimensional matrix, and I want to plot all "i" {x,y} matrices in one graph. How can I do it in a way that I can still distinguish each "i"th curve from the other (I mean creating curves with different colors using plot).

This a example of a code I written, but since I used table to create a loop I couldn't distinguish the curves:

a = Table[Random[], {i, 1, 4}, {x, 1, 6}, {y, 1, 5}];

Show[Table[
aFxn = ListInterpolation[(Chop[a[[i + 1]]] - Chop[a[[i]]])];
Table[aFxn[\[Theta], \[Phi]], {\[Theta], 1, 6}, {\[Phi], 1, 5}];
Plot[Abs[aFxn[3, \[Phi]]], {\[Phi], 1, 5},
PlotLegends -> {Subscript[Ne, i]}, PlotRange -> All,
AxesLabel -> {Ne, spinupcoefficient}], {i, 1, 3}]]


My real matrices have higher dimensions, so I can not use Plot[{},{},{},..] to create the different colors.

I would be thankful if somebody could help me with this.

Here is one option:

curves = Table[
aFxn = ListInterpolation[(Chop[a[[i + 1]]] - Chop[a[[i]]])];
Abs[aFxn[3, ϕ]]
, {i, 1, 3}];

Plot[curves, {ϕ, 1, 5},
PlotLegends -> Table[Subscript[Ne, i], {i, 1, 3}]]


Another option:

curve[i_] :=
ListInterpolation[(Chop[a[[i + 1]]] - Chop[a[[i]]])]

Plot[Evaluate@Table[Abs[curve[i][3, ϕ]], {i, 1, 3}], {ϕ, 1, 5},
PlotLegends -> Table[Subscript[Ne, i], {i, 1, 3}]]


same image

• Thank you, I guess that's what I want Commented Jul 24, 2019 at 23:26
• How to do I show the plotlegends for different colors corresponding to different "i"s? Commented Jul 25, 2019 at 3:28
• I want sth like PlotLegends -> {Subscript[Ne, i]} , corresponding to each i Commented Jul 25, 2019 at 3:30
• adding plot legend after {[Phi], 1, 5} doesn't work for me Commented Jul 25, 2019 at 3:34
• @DelaramNematollahi Updated answer to include PlotLegends. Commented Jul 25, 2019 at 3:37