# Plot multiple solutions [duplicate]

I want to plot multiple solutions of an equation, so that one can differ them in the plot.

The given equation is e.g.

sol = Solve[3 y^2 == x^3 + 7 x^2 + x, {x, y}]

Out: {{y -> -((Sqrt[x] Sqrt[1 + 7 x + x^2])/Sqrt)}, {y -> (
Sqrt[x] Sqrt[1 + 7 x + x^2])/Sqrt}}


Now I have 3 ways to plot the result.

The first one shows them in different colors with legend, but I dont like it, because I have to enter both solutions separately in the plot command:

Plot[{y /. sol[], y /. sol[]}, {x, -10, 10},
PlotLegends -> Automatic] Second command is very short, but shows both solutions in one color without legend. So it could be there is only one solution:

Plot[y /. # & /@ sol, {x, -10, 10}, PlotLegends -> Automatic] The third needs no manual manipulation and shows both solution with an own color:

Module[{res = y /. # & /@ sol},
Plot[res, {x, -10, 10}, PlotLegends -> Automatic]
] But for getting better with Mathematica, is there another/better/smarter way?

• @YvesKlett I agree mikuszefski's answer is a duplicate to this. But I was asking for more/smarter ways doing this. If in the end this should be the best way, yes then it's a duplicate. – Phab Nov 25 '14 at 10:03
• Hmmm, seems pretty neat to me already - what would you be expecting in terms of "smarter"? In fact you can make it even shorter (no need for mapping): Plot[{Evaluate[y /. sol]}, {x, -10, 10}, PlotLegends -> Automatic], but I guess it will not get much better than that ;-) – Yves Klett Nov 25 '14 at 10:11
• @YvesKlett You see ...there's always a way doing things better, shorter or smarter :-) – Phab Nov 25 '14 at 13:49
• Phab, glad you like it! I hope you do not mind the closure - in any case you could edit the question to differentiate it a bit more and nominate it for re-opening. – Yves Klett Nov 25 '14 at 15:15

Your second solution can be improved by Evaluate[] on the first plot argument.
Plot[Evaluate[y /. sol], {x, -10, 10}, 