# Plotting in for loop

I am having some problem while plotting the data being generated in for loop My aim is to plot the result of for loop while it is solving the equation for each value of w,i.e. plot between w and x

Here is the minimum working example

For[w = 0.9925, w < 1.0075, w += 0.0015,
Plot[Solve[{x^6 + x^4 + w*x^2 == 0 , x > 0}, x, Reals], {w}]
]

• Not clear what you are trying to plot there. But these are no solutions any way. If you do For[w = 0.9925, w < 1.0075, w += 0.0015, Print[Solve[{x^6 + x^4 + w*x^2 == 0, x > 0}, x, Reals]] ] then it gives no solution for all values. – Nasser Jul 29 at 8:05
• Sorry for confusion, I want to plot w vs x, where value of w are define by increment and x is the solution of the equation – Shelender Kumar Jul 29 at 8:30
• For & Do loops have no output. Perhaps Table is a better. See also mathematica.stackexchange.com/questions/134609/… -- I'll let the answer speak to how to use Solve and Plot. – Michael E2 Jul 29 at 12:29

ContourPlot has a bug! It missing some curves , for example the x=0 !

 ContourPlot[x^6 + x^4 + w*x^2 == 0, {w, -10, 10}, {x, -10, 10},
PlotPoints -> 50, ContourStyle -> Red, FrameLabel -> {w, x},
LabelStyle -> {FontFamily -> "Times", 16, Blue}]


Or

 Clear["*"];
Solve[x^6 + x^4 + w*x^2 == 0 , x, Method -> Reduce]
Plot[x /. % // Evaluate, {w, -10, 10}, AxesLabel -> {w, x},
LabelStyle -> {FontFamily -> "Times", 12, Blue},
PlotStyle -> {Thickness[0.0125]}]


• Thanks for answering but I need the value of x from the roots of above equation – Shelender Kumar Jul 29 at 9:42
• "Bug" is a little strong. See, for instance, mathematica.stackexchange.com/questions/32734/… – Michael E2 Jul 29 at 12:14
• Here's a hack: ContourPlot[x^6 + x^4 + w*x^2 == \$MachineEpsilon*w,...]. Pretty much requires a symmetric x domain {x, -a, a}` – Michael E2 Jul 29 at 12:24