# Graphing Multiple Initial Conditions

So I have this system of equations that I've solved by hand, but want to graph with multiple initial conditions. But I don't want to have mutiple spamming lines of code like this.

graph1a = ContourPlot[{y^3 == x^3}, {x, -10, 10}, {y, -10, 10}];
graph2a = ContourPlot[{y^3 == x^3 + 2}, {x, -10, 10}, {y, -10, 10}];
graph3a = ContourPlot[{y^3 == x^3 - 2}, {x, -10, 10}, {y, -10, 10}];
graph4a = ContourPlot[{y^3 == x^3 + 15}, {x, -10, 10}, {y, -10, 10}];
graph5a = ContourPlot[{y^3 == x^3 - 15}, {x, -10, 10}, {y, -10, 10}];
graph6a = ContourPlot[{y^3 == x^3 + 75}, {x, -10, 10}, {y, -10, 10}];
graph7a = ContourPlot[{y^3 == x^3 - 75}, {x, -10, 10}, {y, -10, 10}];
Show[graph1a, graph2a, graph3a, graph4a, graph5a, graph6a, graph7a]


I'm pretty sure there's a way to nicely put this into fewer lines. The Equation solution is

y^3 = x^3 + K


with $K$ being the initial condition.

• that would be enough: ContourPlot[{y^3 == x^3 + {0, 2, -2, 15, -15, 75, -75}}, {x, -10, 10}, {y, -10, 10}] – garej Mar 16 '16 at 7:36

What you want to plot are simply some contour lines of a single function, $y^3-x^3$, so there is no need to to Show many graphics overlapped, all the tools are provided by ContourPlot itself:

ContourPlot[y^3 - x^3, {x, -10, 10}, {y, -10, 10},
Contours -> {0, 2, -2, 15, -15, 75, -75},
ContourLabels -> True,
ContourStyle -> Gray
] If you prefer some colors, you can replace the last option with something like ContourStyle -> ColorData[3, "ColorList"]: Show@
Table[
ContourPlot[{y^3 == x^3 + const}, {x, -10, 10}, {y, -10, 10}],
{const, {0, 2, -2, 15, -15, 75, -75}}
] Alternatively,

ContourPlot[
Evaluate[Table[y^3 == x^3 + k, {k, {0, 2, -2, 15, -15, 75, -75}}]], {x, -10,
10}, {y, -10, 10}] Or if you want to augment existing Tooltip

ContourPlot[
Evaluate[Table[y^3 == x^3 + k, {k, {0, 2, -2, 15, -15, 75, -75}}]], {x, -10,
10}, {y, -10, 10}, PlotLegends -> "Expressions"] • Why is there Evaluate function in the argument for ContourPlot? – Smart Humanism Mar 16 '16 at 18:11
• @SmartHumanism - remove the Evaluate and compare the results. Then look at the Attributes for ContourPlot. – Bob Hanlon Mar 16 '16 at 18:16