0
$\begingroup$

My code is as follows:

Clear["Global`*"]
eq = (y - x^2) (y - 2 x^2) == 0;
branches = y /. Solve[eq, y];
Plot[branches, {x, -1, 1}, AspectRatio -> 1, PlotLabel -> eq]
eqExpand = eq // Expand;
tmp = eqExpand[[1, 3]] == -eqExpand[[1, 2]] - eqExpand[[1, 1]]
ContourPlot[y^2 == -2 x^4 + 3 x^2 y, {x, -1, 1}, {y, 0, 2}]

Plot[] works without problems. However, ContourPlot[] shows nothing when I use tmp (built in the previous line); I must write the expression by hand. I am unable to upload images at this time, will try later. Thx!

$\endgroup$
1
  • $\begingroup$ It is not clear why you are manipulating eq for the ContourPlot, rather than just using ContourPlot[eq, {x, -1, 1}, {y, 0, 2}, PlotPoints -> 200] $\endgroup$
    – Bob Hanlon
    Commented Jan 31 at 7:36

1 Answer 1

0
$\begingroup$

MMA 14.0 Windows 10

ContourPlot has some problems near the origin. PlotPoint improves it:

ContourPlot[y^2 == -2  x^4 + 3  x^2  y, {x, -1, 1}, {y, 0, 2},  PlotPoints -> 1000]

enter image description here

$\endgroup$
2
  • $\begingroup$ Much better than my results, @Daniel Huber! My problem remains, however: If I substitute the expression with tmp, nothing is shown. $\endgroup$
    – Coti
    Commented Jan 30 at 18:19
  • 1
    $\begingroup$ I get the same result using "tmp". Check what the value of tmp is. In my case it is tmp $\endgroup$ Commented Jan 30 at 19:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.