# 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?

• Remove the last piece in Show[] and try again. Commented Oct 29, 2015 at 0:18
• How about: Plot[{Sqrt[x^2 - x^4], -Sqrt[x^2 - x^4]}, {x, -2, 2}] Commented Oct 29, 2015 at 0:18
• How is it still not working? Commented Oct 29, 2015 at 0:30
• Try Show[g1, g2, PlotRange -> All] Commented Oct 29, 2015 at 0:48
• Show[g1, g2, PlotRange -> All] that Work! thank you! Commented Oct 29, 2015 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 Commented Oct 29, 2015 at 2:09
• PlotRange controls the frame size regardless of values plotted.Remember Show requires frames to be the same size and range. Commented Oct 29, 2015 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.