Dual plot not working [closed]

I'm trying to plot the figure-eight curve.

g1 = Plot[y = Sqrt[x^2 - x^4], {x, -1, 1}]
g2 = Plot[y = -Sqrt[x^2 - x^4], {x, -1, 1}]
Show[g1, g2 ]


Can someone tell me why it is not working please?

closed as off-topic by MarcoB, user9660, Jason B., Öskå, EdmundMar 4 '16 at 0:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, Community, Jason B., Öskå, Edmund
If this question can be reworded to fit the rules in the help center, please edit the question.

• Remove the last piece in Show[] and try again. – J. M. is away Oct 29 '15 at 0:18
• How about: Plot[{Sqrt[x^2 - x^4], -Sqrt[x^2 - x^4]}, {x, -2, 2}] – bill s Oct 29 '15 at 0:18
• How is it still not working? – J. M. is away Oct 29 '15 at 0:30
• Try Show[g1, g2, PlotRange -> All] – m_goldberg Oct 29 '15 at 0:48
• Show[g1, g2, PlotRange -> All] that Work! thank you! – seito Oct 29 '15 at 2:06

What you probably want is

g1 = Plot[y = Sqrt[x^2 - x^4], {x, -1, 1}];
g2 = Plot[y = -Sqrt[x^2 - x^4], {x, -1, 1}];
Show[g1, g2, PlotRange -> All] g1 = Plot[y = Sqrt[x^2 - x^4], {x, -1, 1}, PlotRange -> {{-1, 1}, {-.5, .5}}];

g2 = Plot[y = -Sqrt[x^2 - x^4], {x, -1, 1}, PlotRange -> {{-1, 1}, {-.5, .5}}];

Show[g1, g2]


Show only works on frames of the same size and range

• why do I have to use PlotRange to make it work I don't understand. event with g1=Plot[f1, {x,-1,1},{y,-.5,.5}] and g1=Plot[f2,{x,-1,1},{y,-.5,.5}] and Show[g1,g2] it's still not work – seito Oct 29 '15 at 2:09
• PlotRange controls the frame size regardless of values plotted.Remember Show requires frames to be the same size and range. – Anon 22 Oct 29 '15 at 4:35

Just put semicolons after the first and second lines.

But you seem to be unfamiliar with Mathematica's syntax. Much better is the approach in the comment from @bill s.